CLI Reference
The Duet CLI gives you full control over your notes, todos, and agents from the terminal. It connects directly to your PostgreSQL database - no API server required.
Installation
npm install -g @noteduet/cliVerify the installation:
duet --versionEnvironment
| Variable | Required | Description |
|---|---|---|
| DUET_DATABASE_URL | Yes | PostgreSQL connection string |
export DUET_DATABASE_URL="postgresql://user:pass@localhost:5432/duet_dev"Note Commands
duet note add [content]
Create a new note. Content can be provided as an argument or piped from stdin.
| Option | Description |
|---|---|
| -t, --title <title> | Set the note title |
| --tag <name> | Add a tag (repeatable: --tag work --tag urgent) |
| --json | Output result as JSON |
# Create a note with title and tags
duet note add "Buy groceries" -t "Shopping List" --tag personal
# Pipe content from a file
cat meeting-notes.md | duet note add -t "Standup Notes"duet note list
List all notes, newest first.
| Option | Description |
|---|---|
| --by <author> | Filter by author (e.g. "human", "agent:claude") |
| --tag <name> | Filter by tag name |
| --archived | Show archived notes |
| --limit <n> | Max results (default 50) |
| --json | Output as JSON |
# List all notes by Claude
duet note list --by agent:claude
# List notes with a specific tag
duet note list --tag engineering --limit 10duet note view <id>
View a note's full content and metadata including title, author, tags, and timestamps.
duet note view abc123duet note edit <id>
Edit an existing note. A new version is created automatically.
| Option | Description |
|---|---|
| -t, --title <title> | Update the title |
| -c, --content <content> | Replace the content |
| --tag <name> | Set tags (repeatable, replaces existing tags) |
duet note edit abc123 -t "Updated Title" -c "New content here"duet note search <query>
Full-text search across all notes using PostgreSQL's search engine.
| Option | Description |
|---|---|
| --limit <n> | Max results (default 20) |
| --json | Output as JSON |
duet note search "deployment checklist" --limit 5duet note archive <id>
Archive a note. The note is hidden from default views but not permanently deleted.
duet note archive abc123duet note unarchive <id>
Restore an archived note back to the active notes list.
duet note unarchive abc123duet note delete <id>
Permanently delete a note. This action is irreversible and requires the -f flag.
duet note delete abc123 --forceduet note history <id>
Show the version history of a note, including who made each change and when.
duet note history abc123Todo Commands
duet todo add <title>
Create a new todo.
| Option | Description |
|---|---|
| -p, --priority <level> | Priority: low, medium, high, urgent (default medium) |
| --due <date> | Due date in ISO 8601 format |
| --assign <name> | Assign to a user or agent |
| --note-id <id> | Link to an existing note |
| --json | Output as JSON |
# Create a high-priority todo with a due date
duet todo add "Review PR #42" -p high --due 2026-03-20T17:00:00Z
# Create a todo linked to a note
duet todo add "Follow up on meeting action items" --note-id abc123duet todo list
List todos with optional filters.
| Option | Description |
|---|---|
| -s, --status <status> | Filter: pending or done |
| -p, --priority <level> | Filter by priority level |
| --due-before <date> | Show todos due before this date |
| --limit <n> | Max results (default 50) |
| --json | Output as JSON |
# List all pending high-priority todos
duet todo list -s pending -p high
# List todos due this week
duet todo list --due-before 2026-03-23T00:00:00Zduet todo done <id>
Mark a todo as complete.
duet todo done abc123duet todo update <id>
Update an existing todo.
| Option | Description |
|---|---|
| -t, --title <title> | Update the title |
| -s, --status <status> | Set status: pending or done |
| -p, --priority <level> | Set priority level |
| --due <date> | Set due date |
duet todo update abc123 -p urgent --due 2026-03-19T12:00:00Zduet todo delete <id>
Permanently delete a todo. Requires the -f flag.
duet todo delete abc123 --forceAgent Commands
duet agent add <name>
Register a new agent and receive an API key. The key is only displayed once.
| Option | Description |
|---|---|
| --permissions <perms> | Comma-separated permissions (default: read,write,archive) |
# Register an agent with default permissions
duet agent add claude
# Register a read-only agent
duet agent add monitor --permissions readduet agent list
List all registered agents with their status and permissions.
| Option | Description |
|---|---|
| --json | Output as JSON |
duet agent listduet agent deactivate <id>
Temporarily deactivate an agent. The agent's API key will stop working until reactivated.
duet agent deactivate abc123duet agent reactivate <id>
Reactivate a previously deactivated agent.
duet agent reactivate abc123duet agent delete <id>
Permanently delete an agent. Requires the -f flag.
duet agent delete abc123 --forceActivity Command
duet activity
View the activity feed showing recent actions by all users and agents.
| Option | Description |
|---|---|
| --limit <n> | Max entries (default 20) |
| --actor <name> | Filter by actor name |
| --type <type> | Filter by entity type: note, todo, agent_key |
| --json | Output as JSON |
# View recent activity by Claude
duet activity --actor claude --limit 10
# View all note-related activity
duet activity --type noteServer Command
duet serve
Start the Duet API server. This is useful for running the web UI alongside the CLI.
| Option | Description |
|---|---|
| -p, --port <port> | Port to listen on (default 7777) |
# Start on default port
duet serve
# Start on a custom port
duet serve -p 3000Tips
- Use
--jsonon any list command to pipe output intojqfor further processing. - Set
DUET_DATABASE_URLin your shell profile so you don't have to provide it every time. - Deletion commands (
delete) always require-f/--forceto prevent accidental data loss. - The CLI connects directly to PostgreSQL, so it works without a running Duet server.