|
1 | | -# Command Line Interface |
| 1 | +# Foam CLI |
2 | 2 |
|
3 | | -Create a CLI tool to allow running common Foam commands. These may include: |
| 3 | +The `foam` command line tool lets you work with your Foam workspace from the terminal — search, inspect, and manage notes without opening VS Code. |
4 | 4 |
|
5 | | -- `foam init` - create a new foam workspace |
6 | | -- `foam janitor` - run [[workspace-janitor]] in current workspace |
7 | | -- `foam migrate <tool>` - migrate from tools like roam exports, obsidian and more |
| 5 | +## Installation |
8 | 6 |
|
9 | | -More commands to be added. |
| 7 | +```bash |
| 8 | +npm install -g @foam/cli |
| 9 | +``` |
10 | 10 |
|
11 | | -[workspace-janitor]: workspace-janitor.md 'Janitor' |
| 11 | +## Usage |
| 12 | + |
| 13 | +``` |
| 14 | +foam <command> [options] |
| 15 | +``` |
| 16 | + |
| 17 | +Set the `FOAM_WORKSPACE` environment variable to avoid typing `--workspace` on every command: |
| 18 | + |
| 19 | +```bash |
| 20 | +export FOAM_WORKSPACE=/path/to/your/notes |
| 21 | +``` |
| 22 | + |
| 23 | +All commands accept `--format json` for machine-readable output, useful for scripting. |
| 24 | + |
| 25 | +## Commands |
| 26 | + |
| 27 | +| Command | Description | |
| 28 | +| ----------- | ------------------------------------------------- | |
| 29 | +| [[daily]] | Show or create the daily note for a date | |
| 30 | +| [[grep]] | Search note content by pattern | |
| 31 | +| [[links]] | Show links to and from a note | |
| 32 | +| [[lint]] | Check notes for issues | |
| 33 | +| [[list]] | List notes, tags, orphans, placeholders, and more | |
| 34 | +| [[note]] | Show, create, move, or delete notes | |
| 35 | +| [[outline]] | Show the heading structure of a note | |
| 36 | +| [[rename]] | Rename notes, tags, sections, or block anchors | |
| 37 | +| [[search]] | Search notes by title, tag, or frontmatter | |
| 38 | +| [[tag]] | List, rename, or search tags | |
| 39 | + |
| 40 | +[daily]: cli/daily.md 'foam daily' |
| 41 | +[grep]: cli/grep.md 'foam grep' |
| 42 | +[links]: cli/links.md 'foam links' |
| 43 | +[lint]: cli/lint.md 'foam lint' |
| 44 | +[list]: cli/list.md 'foam list' |
| 45 | +[note]: cli/note.md 'foam note' |
| 46 | +[outline]: cli/outline.md 'foam outline' |
| 47 | +[rename]: cli/rename.md 'foam rename' |
| 48 | +[search]: cli/search.md 'foam search' |
| 49 | +[tag]: cli/tag.md 'foam tag' |
0 commit comments