{"id":13707032,"url":"https://github.com/tx3stn/pkb","last_synced_at":"2026-04-09T06:42:11.831Z","repository":{"id":177572358,"uuid":"535802752","full_name":"tx3stn/pkb","owner":"tx3stn","description":"Config driven CLI to manage markdown files for a personal knowledge base.","archived":false,"fork":false,"pushed_at":"2025-06-01T15:12:45.000Z","size":114,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T06:05:00.284Z","etag":null,"topics":["cli","documentation","go","golang","knowledge-base","knowledge-management","markdown","nvim","obsidian","obsidian-md","obsidian-notes","pkb","pkm","templating","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tx3stn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-12T18:37:51.000Z","updated_at":"2025-06-02T08:55:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b93e1c5-be41-4ba9-9747-70b746f92554","html_url":"https://github.com/tx3stn/pkb","commit_stats":null,"previous_names":["thaffenden/pkb","tx3stn/pkb"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/tx3stn/pkb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx3stn%2Fpkb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx3stn%2Fpkb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx3stn%2Fpkb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx3stn%2Fpkb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tx3stn","download_url":"https://codeload.github.com/tx3stn/pkb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx3stn%2Fpkb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259768605,"owners_count":22908229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","documentation","go","golang","knowledge-base","knowledge-management","markdown","nvim","obsidian","obsidian-md","obsidian-notes","pkb","pkm","templating","terminal"],"created_at":"2024-08-02T22:01:16.132Z","updated_at":"2025-12-24T17:37:35.824Z","avatar_url":"https://github.com/tx3stn.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# pkb\n\n**P**ersonal **K**nowledge **B**ase\n\nConfig driven CLI to manage the notes and documents that make up your personal\nknowledge base.\n\n![pkb-demo](https://github.com/user-attachments/assets/686ba6d8-fb42-4dab-a740-cb897231c0aa)\n\n## Contents\n\n- [Why?](#why)\n- [Install](#install)\n  - [Download from GitHub](#download-from-github)\n  - [Build it locally](#build-it-locally)\n- [Commands](#commands)\n- [Configuration](#configuration)\n  - [Schema](#schema)\n  - [Expanding values in templates](#expanding-values-in-templates)\n  - [Custom file name formats](#custom-file-name-formats)\n  - [Selecting an output directory](#selecting-an-output-directory)\n  - [Accessible mode](#accessible-mode)\n- [Using with Obsidian](#using-with-obsidian)\n  - [Expanding Obsidian Template Variables](#expanding-obsidian-template-variables)\n- [Using with multiple vaults or computers](#using-with-multiple-vaults-or-computers)\n\n## Why?\n\nI use [Obsidian](https://obsidian.md/) for reading/reviewing and minor updates\nbut don't enjoy writing content there as much as I do in\n[Neovim](https://neovim.io/).\n\nI'm more likely to keep good notes and actually maintain documents if the\nediting is done in Neovim rather than having to launch a specific app every\ntime I need to jot something down.\n\n`pkb` is designed to be terminal first so you can create and edit documents\nwhere you are most comfortable, but is fully compatible with Obsidian. See\n[using with Obsidian](#using-with-obsidian) for specifics on how to set them up\nto work together in perfect harmony.\n\nDon't use Obsidian for your own knowledge base?\n`pkb` is just creating markdown documents from templates, so it's **probably**\ncompatible with whatever you are using! If it's not but you would like it to be\njust raise an issue and I'll see what I can do 🤞.\n\n## Install\n\n### Download from GitHub\n\nFind the latest version for your system on the\n[GitHub releases page](https://github.com/tx3stn/pkb/releases).\n\n### Build it locally\n\nIf you have go installed, you can clone this repo and run:\n\n```bash\nmake install\n```\n\nThis will build the binary and then copy it to `/usr/local/bin/pkb` so it will be\navailable on your path. Nothing more to it.\n\n## Commands\n\nRun `pkb --help` for a full, up to date list of available commands.\n\n### `new`\n\nCreate a new note/file from your defined templates.\n\nYou will be prompted to select the template (and if defined, any sub templates)\nthen the file will be opened in the editor specified in your config file.\n\nDon't want to edit it right now? Just use `--no-edit`. The file will still be\ncreated, just not opened.\n\n![pkb-new-demo](https://github.com/user-attachments/assets/63cce0d5-726f-4903-addf-dc0c254b2c08)\n\n### `edit`\n\nSelect an existing note and open it in your editor.\n\n![pkb-edit-demo](https://github.com/user-attachments/assets/d81b65ca-1afa-46e9-8e1e-e5345334997e)\n\n### `copy`\n\nCopy the contents of a file to your system clipboard.\n\nUseful if you want to write up notes about something in your editor, but then\nneed to share them somewhere for other people to read.\n\n![pkb-copy-demo](https://user-images.githubusercontent.com/14163530/197569321-92c11700-7c43-4050-9e5b-123a1e8d38cf.gif)\n\n### `open`\n\nOpen your notes directory in your specified editor.\n\n\n## Configuration\n\nConfig driven means **you** control how `pkb` works with the options in a\nconfig file.\n\nBy default `pkb` checks for a config file called `pkb.json` in your `$XDG_CONFIG_DIR`, \nor `$HOME/.config` in a directory called `pkb`, e.g: `$HOME/.config/pkb/pkb.json`.\n\nSee  [Using with multiple vaults or computers](#using-with-multiple-vaults-or-computers)\nif you want to support multiple different config files for different uses.\n\n### Schema\n\nYou can see an example of the config file format in the\n[pkb.json](./.schema/pkb.json) in the schema directory.\n\n\u003e [!TIP]\n\u003e Make sure you add the `$schema` keyword to the top of your config file to\n\u003e for in editor validation and descriptions of what fields are used for.\n\n### Expanding values in templates\n\nThe following values will be automatically expanded in templates:\n\n- `{{.CustomDateFormat}}` - the current date in a custom format specified in the\ntemplate config. This must be a valid golang date format, with the exception\nof day suffixes (e.g. 1st, 3rd etc). If your format contains a day suffix this\nwill be be handled so the suffix is correctly displayed. The format string needs\nto be included in the template config to be able to use a custom date format.\n- `{{.Date}}` - the current date in the format YYYY-MM-DD.\n- `{{.Directory}}` - the name of the parent directory.\n- `{{.Name}}` - the name of the created document.\n- `{{.SelectFromList \"filename.json\"}}` - multiple select options from a json file\nin the same directory as the template, then render the selected options as a comma\nseparated list if multiple are selected.\n- `{{.Time}}` - the time the file was created in the format HH:MM.\n- `{{.Week}}` - the current week number.\n- `{{.Year}}` - the current year.\n\nSee [Expanding Obsidian Template Variables](#expanding-obsidian-template-variables)\nfor details on using the default Obsidian template values.\n\n### Custom file name formats\n\nBy default when you create a new file from a template you will be prompted to\nenter the name value, however you can customise with `name_format`.\n\nThe following values are currently supported:\n\n- `{{.Date}}` - the current date in the format `YYYY-MM-DD`.\n- `{{.Prompt}}` - prompt for user input.\n- `{{.Week}}` - the current week number.\n- `{{.Year}}` - the current year.\n\n\u003e [!TIP]\n\u003e You can combine the supported formats to use them together, e.g.:\n\u003e \n\u003e ```json\n\u003e \"name_format\": \"{{.Date}}-{{.Prompt}}\"\n\u003e ```\n\u003e \n\u003e In this example the document would be created with the current date then the\n\u003e value you typed in the prompt, e.g. `2022-09-19-typed-value.md`.\n\n### Selecting an output directory\n\nIf you don't want to hard code the output directory in your config you can use\nthe dynamic values to prompt you for input at time of creation.\n\nThe following values are currently supported:\n\n- `{{.Prompt}}` - will let you type in a new directory name. If the directory\ndoes not already exist it will be created.\n- `{{.Select}}` - select from existing directories inside the parent.\n- `{{.Year}}` - the current year.\n\n### Accessible mode\n\nSome of the options when creating a file spawn interactive TUI elements. \nIf you would prefer for them to use standard prompt elements which should work \nbetter with screen reader tools, you can set `\"accessible_mode\": true` in your \nconfig file.\n\n![accessible mode](https://github.com/user-attachments/assets/e6638d47-311a-4a88-875c-e3c6499e67cc)\n\n## Using with Obsidian\n\nTo get the best out of `pkb` **and** `Obsidian`, you just need to tell them to\nboth look in the same place for your files.\n\nIf you already have an `Obsidian` vault just set the `directory` in your `pkb`\nconfig file to the same location.\n\n`pkb` will expect templates to be in the directory defined in the `templates_dir`\nfield of your config file inside the location you specified as the `directory`\nYou can make sure `Obsidian` is using the same location by going to\n`Settings \u003e Templates` and setting the `Template folder location` value.\n\n![Template folder location](https://user-images.githubusercontent.com/14163530/197546420-02c0c607-93db-454b-9d38-743e23a879f3.png)\n\n### Expanding Obsidian Template Variables\n\nFor ease of compatibility `pkb` can expand [the default Obsidian template values](https://help.obsidian.md/plugins/templates).\n\n- `{{date}}` - today's date (in the format `YYYY-MM-DD`).\n- `{{time}}` - the current time (in the format `HH:mm`).\n- `{{title}}` - the title of the created note.\n\nIt does **not** currently support the MomentJS format tokens you can specify to\ncustomise the `date` and `time` values, as the syntax for this breaks the standard\ngo template syntax used by `pkb`, so the templates would need to be pre-processed\nbefore they are rendered. This *may* be implemented in a future update, so if it's\nsomething you would like to see please create an issue requesting it.\n\n## Using with multiple vaults or computers\n\nIf you use `Obsidian` with multiple vaults, or on multiple computers, you may\nwish to have different templates and therefore different `pkb` config files for\neach vault or computer.\n\nTo support this `pkb` offers the `--vault` flag, which you can use to specify\nthe name of the config file in your config directory, without needing to pass\nthe full file path with the `--config` flag. e.g.:\n\nIf your `pkb` config directory looked like this:\n\n```bash\npkb/\n\t./pkb.json\n\t./personal.json\n\t./work.json\n```\n\nYou could run the command:\n\n```bash\npkb --vault work new\n```\n\nTo use the `work.json` config file to create a new document.\n\n\u003e [!TIP] \n\u003e `pkb.json` is the name of the default config file.\n\u003e If no file with this name exists in your config directory and you don't\n\u003e specify a `--vault` flag, `pkb` will error.\n\u003e If you want to keep your configs aligned to your vaults you will need to \n\u003e either always pass the `--vault` flag, or make one of them your default and\n\u003e keep that vault's config in `pkb.json`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftx3stn%2Fpkb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftx3stn%2Fpkb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftx3stn%2Fpkb/lists"}