devbook-cli
v1.0.1
Published
DevBook CLI - Access your developer knowledge vault from the terminal
Maintainers
Readme
DevBook CLI
Access your developer knowledge vault from the terminal. Search, add, and manage your notes and errors without leaving the command line.
Installation
npm install -g devbook-cliAuthentication
DevBook CLI offers multiple ways to authenticate:
devbook loginYou will be presented with three options:
| Method | Description | | ---------------- | ------------------------------------------------- | | Email & Password | Sign in with your DevBook credentials | | API Token | Paste a token from Settings > API & CLI | | Web App | Opens DevBook in your browser to generate a token |
Direct Token Login (One-liner)
devbook login --token dvbk_your_token_hereCustom API URL
devbook login --token dvbk_xxx --api-url https://your-devbook-instance.comCommands
Authentication
| Command | Description |
| ------------------------------- | ------------------------------- |
| devbook login | Interactive multi-option login |
| devbook login --token <token> | Direct token authentication |
| devbook logout | Clear stored authentication |
| devbook whoami | Show current authenticated user |
Notes & Errors
| Command | Description |
| ----------------------------------------- | --------------------------------- |
| devbook list | List your notes |
| devbook list --type error | List only error entries |
| devbook list --filter favorites | List favorited notes |
| devbook list --sort title_asc | Sort by title |
| devbook list --limit 20 --page 2 | Pagination |
| devbook search "query" | Full-text search |
| devbook search "CORS" --type error | Search errors only |
| devbook view | Select a note from list to view |
| devbook view <slug> | View a specific note by slug |
| devbook add | Create a note interactively |
| devbook add --quick | Quick note (title + content) |
| devbook error "title" -m "msg" -s "fix" | Quick error entry |
| devbook copy | Select a note and command to copy |
| devbook copy <slug> | Copy command from a specific note |
Aliases
| Shorthand | Full Command |
| ------------ | ---------------- |
| devbook ls | devbook list |
| devbook s | devbook search |
| devbook v | devbook view |
| devbook cp | devbook copy |
Examples
Search and view a note
devbook search "docker permission denied"
# Results displayed -> select a note to view inlineInteractive view (no slug needed)
devbook view
# Select from your recent notesCopy a command interactively
devbook copy
# 1. Select a note from the list
# 2. Select a command from the note
# -> Copied to clipboard!Quick error logging
devbook error "ENOENT: no such file" \
-m "Error: ENOENT: no such file or directory, open '/app/config.json'" \
-s "Create the config file: touch /app/config.json" \
--tag "node,filesystem"Interactive note creation
devbook add
# 1. Choose type -> Note or Error
# 2. Fill in fields via inline prompts (no external editor needed)
# 3. Note created!Update Notifications
DevBook CLI automatically checks for new versions once every 24 hours. When a newer version is available, you will see a notice after command execution:
──────────────────────────────────────────────────
Update available: 1.0.0 -> 1.1.0
Run npm install -g devbook-cli to update
──────────────────────────────────────────────────To manually update:
npm install -g devbook-cli@latestUninstalling
To completely remove DevBook CLI from your system:
1. Uninstall the package
npm uninstall -g devbook-cli2. Remove config directory (optional)
macOS / Linux:
rm -rf ~/.devbookWindows (PowerShell):
Remove-Item -Recurse -Force "$env:USERPROFILE\.devbook"Windows (CMD):
rmdir /S /Q "%USERPROFILE%\.devbook"This removes your stored API token and configuration. Your notes and data remain safely stored in your DevBook account.
Configuration
Config is stored at ~/.devbook/config.json:
{
"apiUrl": "http://localhost:3000",
"token": "dvbk_..."
}File permissions are set to 600 (owner read/write only) on Unix systems.
Developer
Developer - Neel Sapariya
- GitHub - sapariyaneel
- Twitter/X - sapariyaneel_
- LinkedIn - neelsapariya
- Portfolio - https://neelsapariya.in
License
MIT
