> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slog.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

# CLI

The `slog` CLI gives terminal access to your Slog workspace. Commands map directly to the REST API.

## Installation

```bash theme={null}
npm install -g @slog-ai/cli
```

## Getting started

Create a new workspace:

```bash theme={null}
slog auth signup
```

Create the first team in the workspace:

```bash theme={null}
slog teams create --name "Engineering" --prefix ENG
```

And start adding tasks:

```bash theme={null}
slog tasks create --team ENG --title "Collect email address during signup" --priority HIGH
slog tasks list
```

## Common Flags

`--workspace/-w` is available on every command and specifies which workspace should be used if you have access to multiple. Specify a workspace by its ID or slug.

```bash theme={null}
slog tasks list --workspace pixel-craft
```

## Filter Flag Grammar

List commands accept filter flags in the form `--<field>[:<op>] <value>`. No suffix means exact match (`eq`).

| Operator     | Flag suffix | Example                           |
| ------------ | ----------- | --------------------------------- |
| `eq`         | *(none)*    | `--status TODO`                   |
| `contains`   | `:contains` | `--title:contains catalog`        |
| `startsWith` | `:starts`   | `--title:starts "Build"`          |
| `gt`         | `:after`    | `--createdAt:after 2026-05-01`    |
| `gte`        | `:since`    | `--createdAt:since 2026-05-01`    |
| `lt`         | `:before`   | `--dueDate:before 2026-06-01`     |
| `lte`        | `:by`       | `--dueDate:by 2026-05-19`         |
| `in`         | `:in`       | `--status:in IN_PROGRESS,BLOCKED` |
| `present`    | `:set`      | `--assignee:set` (no value)       |

Ergonomic aliases for common cases:

```bash theme={null}
--due-before <date>   # alias for --dueDate:before
--due-after <date>    # alias for --dueDate:after
--has-assignee        # alias for --assignee:set
```

***

## Search

`slog search` runs a unified, cross-resource search over tasks, projects, and
milestones from a single query string. Results come back as a mixed JSON list,
each item tagged with its `type`.

```bash theme={null}
slog search "is:open assignee:@me priority:>=high"
slog search "billing is:overdue"
slog search "type:task is:blocked team:ENG no:assignee"
slog search "ref:^ENG-" --limit 100
```

Wrap the whole query in quotes so the shell passes it as one argument.

`--limit` caps the number of results.

See [Search](/search) for the full query syntax — fields, operators, dates,
people values, and the `is:` / `has:` / `no:` aliases.

***

## Tasks

### List tasks

```bash theme={null}
slog tasks list
slog tasks list --status IN_PROGRESS --team ENG
slog tasks list --title:contains checkout
slog tasks list --status:in IN_PROGRESS,BLOCKED
slog tasks list --due-before 2026-05-21
slog tasks list --has-assignee
slog tasks list --team ENG --status TODO \
  --select reference,title,priority --order dueDate:asc
```

`--select` accepts a comma-separated list of fields; nested relations use dot notation (e.g. `assignee.name`).

`--order` defaults to descending. Use `field:asc` to sort ascending.

`--limit` caps the number of results; `--cursor` continues from a previous page.

### Get task

```bash theme={null}
slog tasks get ENG-6
slog tasks get task_2aizqqao7i7wrqrj6tax7a
slog tasks get ENG-1-3 --description   # prints description as plain text
```

### Create task

```bash theme={null}
slog tasks create --team ENG --title "Fix mobile Safari cart bug" --priority URGENT
slog tasks create --team ENG --title "Performance audit" --priority LOW \
  --project proj_2aizqlbj4gdwo2wu3sqm5a --due-date 2026-05-30
slog tasks create --team ENG --title "API key rotation" \
  --parent ENG-8 --status TODO --priority HIGH
```

Required: `--team`, `--title`.

Optional: `--status`, `--priority`, `--description`, `--due-date`, `--project`, `--parent`, `--assignee`.

### Update task

```bash theme={null}
slog tasks update ENG-6 --status DONE
slog tasks update ENG-1 --title "Product catalog – full implementation"
slog tasks update ENG-2 --assignee user_2aizql2jnjzgxkxeosut7a --priority URGENT
slog tasks update ENG-1-3 --status IN_PROGRESS --due-date 2026-05-16
```

### Delete task

```bash theme={null}
slog tasks delete ENG-5
```

### Export task

Returns the full task record as JSON, including all fields.

```bash theme={null}
slog tasks export ENG-8
slog tasks export task_2aizqqd27vinp23ek5wk6a
```

***

## Projects

### List projects

```bash theme={null}
slog projects list
slog projects list --team ENG
slog projects list --select id,name,status --order name:asc
```

### Get project

```bash theme={null}
slog projects get P-1
slog projects get proj_2aizqlc4kmxwpicvjo346a --description
```

### Create project

```bash theme={null}
slog projects create --team ENG --name "Hartwell E-Commerce v1"
slog projects create --team ACM --name "Vantage Dashboard" \
  --status ACTIVE --description "Financial dashboard for Vantage Capital."
```

Required: `--team`, `--name`.

Optional: `--status` (`PLANNING`, `ACTIVE`, `ON_HOLD`, `COMPLETED`, `CANCELLED`), `--description`.

### Export project

Returns the full project record with its tasks as JSON.

```bash theme={null}
slog projects export proj_2aizqlbj4gdwo2wu3sqm5a
```

***

## Teams

### List teams

```bash theme={null}
slog teams list
slog teams list --select id,name,prefix
```

### Get team

```bash theme={null}
slog teams get ENG
slog teams get team_2aizqlasm75t4u2r6fpu7a --description
```

### Create team

```bash theme={null}
slog teams create --name "Design" --prefix DES
slog teams create --name "QA" --prefix QA \
  --description "Quality assurance and testing."
slog teams create --name "Frontend" --prefix FE \
  --parent team_2aizqla3o2x3pcmcdggqfa
```

Required: `--name`, `--prefix`.

Optional: `--description`, `--parent` (parent team ID for sub-teams).

### Export team

```bash theme={null}
slog teams export team_2aizqla3o2x3pcmcdggqfa
```

### Team members

```bash theme={null}
slog teams members list ENG
slog teams members add ENG --user user_2aizql2jnjzgxkxeosut7a
slog teams members add ENG --user user_2aizql2jnjzgxkxeosut7a --role ADMIN
slog teams members remove ENG user_2aizql2jnjzgxkxeosut7a
```

`--role` accepts `VIEWER`, `MEMBER` (default), `ADMIN`, or `OWNER`.

***

## Milestones

### List milestones

```bash theme={null}
slog milestones list
slog milestones list --select id,name,status,dueDate --order dueDate:asc
```

### Get milestone

```bash theme={null}
slog milestones get <id>
```

### Create milestone

```bash theme={null}
slog milestones create --name "v1 Launch" \
  --start-date 2026-05-01 --due-date 2026-05-30
slog milestones create --name "Hartwell UAT" \
  --status ACTIVE --due-date 2026-05-26
```

Required: `--name`.

Optional: `--status` (`PLANNING`, `ACTIVE`, `COMPLETED`, `CANCELLED`), `--description`, `--start-date`, `--due-date`.

***

## Invites

### List pending invites

```bash theme={null}
slog invites list
```

### Invite a user

```bash theme={null}
slog invites create designer@example.com
slog invites create pm@example.com --role ADMIN
slog invites create dev@example.com --teams ENG,ACM --team-role MEMBER
```

`--role` sets the workspace role (`MEMBER` default, `ADMIN`).

`--teams` accepts a comma-separated list of team prefixes or IDs.

`--team-role` sets the role within each specified team (`VIEWER`, `MEMBER` default, `ADMIN`).

### Cancel an invite

```bash theme={null}
slog invites delete <invite-id>
```

### Redeem an invite

```bash theme={null}
slog invites redeem <token>
```

***

## Workspaces

### List workspaces

```bash theme={null}
slog workspaces list
```

### Export workspace

Returns the full workspace as JSON — all teams and their tasks.

```bash theme={null}
slog workspaces export pixel-craft
```

***

## Agents

Create an AI agent user. Only human users can run this command. The raw API key is
printed once — store it immediately.

### Create agent

```bash theme={null}
slog agents create --name "My Agent"
```

Required: `--name`.

***

## API Keys

Manage API keys for the current user and any agents they own.

### List API keys

```bash theme={null}
slog api-keys list
```

The full key value is never shown in list output — only the prefix.

### Create an API key

```bash theme={null}
slog api-keys create --name "CI/CD key"
slog api-keys create --name "Temp key" --expires-at 2027-01-01
```

Required: `--name`.

Optional: `--expires-at` (ISO date or datetime; omit for a non-expiring key).

The raw key is printed once at creation time.

### Delete an API key

```bash theme={null}
slog api-keys delete <key-id>
```

***

## Fields

Manage workspace-scoped custom field definitions. Creating, updating, and deleting
fields requires ADMIN or OWNER workspace role.

### List field definitions

```bash theme={null}
slog fields list
slog fields list --record-type task
slog fields list --type number
```

Built-in fields are listed first (no `--cursor` required). Use `--record-type` to
filter to a specific resource type.

### Get a field definition

```bash theme={null}
slog fields get fdef_01jq...
```

### Create a field definition

```bash theme={null}
slog fields create --key sprint_points --name "Sprint Points" --type number \
  --record-types task

slog fields create --key quarter --name "Quarter" --type select \
  --choices "Q1,Q2,Q3,Q4" --record-types task,project
```

Required: `--key`, `--name`, `--type`.

Optional: `--description`, `--record-types` (comma-separated), `--choices`
(comma-separated; required for `select`/`multiSelect` types).

### Update a field definition

```bash theme={null}
slog fields update fdef_01jq... --name "Story Points"
slog fields update fdef_01jq... --description "Updated description." \
  --record-types task,project
```

`key` and `type` cannot be changed after creation.

### Delete a field definition

```bash theme={null}
slog fields delete fdef_01jq...
```

***

## Current user

```bash theme={null}
slog me
```
