# Space commands

List, show and create Spaces, and manage them with the project commands.

Web version: https://www.svanja.com/docs/cli/spaces/

A Space is the folder for one client or project, holding its notes and files. You can find yours in [Spaces](https://app.svanja.com/spaces). Most other commands need a Space id, so this is usually where you start. Run `svanja space list` to see your Spaces with their ids, `svanja space show` to view one, and `svanja space create` to add a new one.

To read Spaces, your key needs the Spaces area, which Full access and Read-only keys include. To create one, you need Full access or Spaces set to **Read and write**. A key limited to certain Spaces can't create new ones. For more background, see [Spaces, notes and files](https://www.svanja.com/docs/spaces/).

```bash
svanja space create --field name="Website relaunch" --field kind=project --field language=en-US
```

A client Space belongs to a company, so you also need to pass `new_company_name` for a new company, or `mail_account_public_id` with the id of an existing one from `svanja crm company list`.

The `svanja project` commands work on the same Spaces under their earlier name. They also let you rename, pause, archive, or delete a Space. Deleting asks for confirmation first unless you pass `--force`.

## Commands

### svanja project archive

Archive a project visible to the active team API key.

Identify the project by its opaque id. Every non-empty value is sent as one escaped API path segment without local normalization. The command sends exactly one PATCH body: {"status":"archived"}. The API remains authoritative for transition validation: the CLI does not read the project first or enforce a transition graph.

Every real update sends an idempotency key so a retried request is not applied twice. A key is generated automatically; pass --idempotency-key <key> to supply your own (1-255 visible ASCII bytes). Key values are sensitive: output reports only whether a key is generated or explicit and never prints the value. Use --dry-run to preview the method, path, body fields, and idempotency behavior without resolving credentials or contacting the API.

JSON output is the bare project object with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at. Every field comes from the API response, including status; the requested status is never substituted into output. Default JSON without --include-meta has no request, replay, idempotency, or metadata wrapper.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

Output modes: default human summary, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

This reversible status update does not ask for confirmation; inherited --force does not change execution. Use svanja project update when changing status together with other project fields or when supplying a generic JSON change set.

```text
svanja project archive <project-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |

```bash
svanja project archive <project-id>
svanja project archive <project-id> --dry-run --json
svanja project archive <project-id> --jq .status
svanja project archive <project-id> --include-meta --template '{{.meta.request_id}}'
```

### svanja project create

Create a project for the active team.

Build the request body from field flags or from a JSON body. Set individual fields with --name (required), --description, --url, --status (active, paused, archived), --timezone, --language, --limit, and --automate; only the flags you set are sent, so --description "" sends an explicit empty value while an omitted flag is left out. Field flags cannot be combined with body input. Alternatively pass the whole body as JSON with --body '<json>' or --body-file <path>, and use --body-file - to read the body from stdin. JSON body input must be a top-level object whose keys are a subset of the documented fields with the documented scalar types; field-value rules such as a required name are checked by the API.

--limit is the project resource's integer limit field sent in the body; it is not a pagination control here. --language is the project content language sent in the body and is independent of the global --locale flag, which only sets the request Accept-Language header.

Every real create sends an idempotency key so a retried request is not applied twice. A key is generated automatically; pass --idempotency-key <key> to supply your own (1-255 visible ASCII bytes). Key values are sensitive: output reports only whether a key is generated or explicit and never prints the value. Use --dry-run to preview the method, path, body fields, and idempotency behavior without resolving credentials or contacting the API.

JSON output is the bare project object with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at. Default JSON without --include-meta has no request, replay, idempotency, or metadata wrapper.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

Output modes: default human summary, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

```text
svanja project create [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--automate` | project automate flag (sent in the body) |
| `--body` | JSON request body (mutually exclusive with field flags and --body-file) |
| `--body-file` | read the JSON request body from a file, or - for stdin |
| `--description` | project description (sent in the body; --description "" clears it) |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |
| `--language` | project content language (sent in the body; distinct from the global --locale) |
| `--limit` | project resource limit field (sent in the body; not a pagination control) |
| `--name` | project name (sent in the body) |
| `--status` | project status: active, paused, or archived |
| `--timezone` | project timezone (sent in the body; validated by the API) |
| `--url` | project URL (sent in the body) |

```bash
svanja project create --name "Demo"
svanja project create --name "Demo" --status active --description ""
svanja project create --body '{"name":"Demo","status":"active"}'
svanja project create --body-file project.json
svanja project create --name "Demo" --dry-run
svanja project create --name "Demo" --idempotency-key <key>
svanja project create --name "Demo" --json
svanja project create --name "Demo" --json --include-meta
svanja project create --name "Demo" --jq .id
svanja project create --name "Demo" --template '{{.id}}'
```

### svanja project delete

Delete a project visible to the active team API key.

Identify the project by its opaque id (sent to the API as-is, only checked non-empty locally), so malformed, missing, deleted, cross-team, and out-of-scope ids all return the API's resource_not_found response. A successful response is the deleted id and a Boolean deleted flag.

Deleting a project is destructive. In an interactive terminal the command asks for confirmation before sending the request; the prompt uses a quoted, redacted copy of the id and makes no claim about whether the project exists. Pass --force to confirm without a prompt. In non-interactive or --no-prompt mode a real delete without --force fails locally before any credential lookup or request.

Every real delete sends an idempotency key so a retried request is not applied twice. A key is generated automatically; pass --idempotency-key <key> to supply your own (1-255 visible ASCII bytes). Key values are sensitive: output reports only whether a key is generated or explicit and never prints the value. Use --dry-run to preview the method, path, and idempotency behavior without confirming, resolving credentials, or contacting the API.

JSON output is exactly one object with string id and Boolean deleted fields. Without --include-meta, transport and replay context is not shown.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

Output modes: default human summary, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

```text
svanja project delete <project-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |

```bash
svanja project delete <project-id>
svanja project delete <project-id> --force
svanja project delete <project-id> --dry-run
svanja project delete <project-id> --idempotency-key <key>
svanja project delete <project-id> --json
svanja project delete <project-id> --json --include-meta
svanja project delete <project-id> --jq .deleted
svanja project delete <project-id> --template '{{.id}}'
```

### svanja project list

List projects visible to the active team API key.

Filters map to API query parameters: --status (active, paused, archived), --search (API q parameter), and --sort. --sort is passed through to the API sort parameter unchanged; the API rejects unsupported sort fields.

Pagination: --limit caps the total items fetched across pages, --all fetches every page, and --page/--per-page fetch one exact page. With no list-size flag the resolved defaults.project_list_limit is used (default 30).

JSON output is an array of project objects with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at. Default JSON omits request and pagination metadata.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged.

Output modes: default human table, --plain tab-separated rows, --json stable JSON, and --jq/--template transforms over the documented JSON value.

```text
svanja project list [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--all` | fetch every page |
| `--limit` | maximum total number of items to fetch across pages |
| `--page` | fetch one exact page number |
| `--per-page` | items per page (1-100) for exact page mode |
| `--search` | search projects using the API q parameter |
| `--sort` | API project sort field to pass through unchanged |
| `--status` | filter by project status (active, paused, archived) |

```bash
svanja project list
svanja project list --status active --search demo --sort=-name
svanja project list --page 2 --per-page 50
svanja project list --json
svanja project list --all --json --include-meta
svanja project list --jq '.[].id'
svanja project list --template '{{range .}}{{.id}}{{"\n"}}{{end}}'
```

### svanja project pause

Pause a project visible to the active team API key.

Identify the project by its opaque id. Every non-empty value is sent as one escaped API path segment without local normalization. The command sends exactly one PATCH body: {"status":"paused"}. The API remains authoritative for transition validation: the CLI does not read the project first or enforce a transition graph.

Every real update sends an idempotency key so a retried request is not applied twice. A key is generated automatically; pass --idempotency-key <key> to supply your own (1-255 visible ASCII bytes). Key values are sensitive: output reports only whether a key is generated or explicit and never prints the value. Use --dry-run to preview the method, path, body fields, and idempotency behavior without resolving credentials or contacting the API.

JSON output is the bare project object with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at. Every field comes from the API response, including status; the requested status is never substituted into output. Default JSON without --include-meta has no request, replay, idempotency, or metadata wrapper.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

Output modes: default human summary, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

This reversible status update does not ask for confirmation; inherited --force does not change execution. Use svanja project update when changing status together with other project fields or when supplying a generic JSON change set.

```text
svanja project pause <project-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |

```bash
svanja project pause <project-id>
svanja project pause <project-id> --dry-run --json
svanja project pause <project-id> --jq .status
svanja project pause <project-id> --template '{{.id}}'
```

### svanja project resume

Resume a project visible to the active team API key.

Identify the project by its opaque id. Every non-empty value is sent as one escaped API path segment without local normalization. The command sends exactly one PATCH body: {"status":"active"}. The API remains authoritative for transition validation: the CLI does not read the project first or enforce a transition graph.

Every real update sends an idempotency key so a retried request is not applied twice. A key is generated automatically; pass --idempotency-key <key> to supply your own (1-255 visible ASCII bytes). Key values are sensitive: output reports only whether a key is generated or explicit and never prints the value. Use --dry-run to preview the method, path, body fields, and idempotency behavior without resolving credentials or contacting the API.

JSON output is the bare project object with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at. Every field comes from the API response, including status; the requested status is never substituted into output. Default JSON without --include-meta has no request, replay, idempotency, or metadata wrapper.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

Output modes: default human summary, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

This reversible status update does not ask for confirmation; inherited --force does not change execution. Use svanja project update when changing status together with other project fields or when supplying a generic JSON change set.

```text
svanja project resume <project-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |

```bash
svanja project resume <project-id>
svanja project resume <project-id> --idempotency-key <key> --json
svanja project resume <project-id> --jq .status
svanja project resume <project-id> --template '{{.id}}'
```

### svanja project show

Show a project visible to the active team API key.

The project id is opaque: every non-empty value is sent to the API as one path segment without trimming, decoding, normalization, or local shape validation. Malformed, deleted, cross-team, and out-of-scope ids all return the API's resource_not_found response.

JSON output is one project object with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged.

Output modes: default human detail, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

```text
svanja project show <project-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

```bash
svanja project show <project-id>
svanja project show <project-id> --json
svanja project show <project-id> --json --include-meta
svanja project show <project-id> --jq .status
svanja project show <project-id> --template '{{.id}} {{.name}}'
```

### svanja project update

Update a project visible to the active team API key.

Identify the project by its opaque id. Every non-empty value is sent as one escaped API path segment without local normalization. Build the change set from field flags or from a JSON body. Set any of --name, --description, --url, --status (active, paused, archived), --timezone, --language, --limit, and --automate; only the flags you set are sent, so --description "" clears the description while an omitted flag is left unchanged. Field flags cannot be combined with body input. Alternatively pass the whole change set as JSON with --body '<json>' or --body-file <path>, and use --body-file - to read it from stdin. At least one field must change: an update with no fields, including --body '{}', fails locally before any request.

--limit is the project resource's integer limit field sent in the body; it is not a pagination control here. --language is the project content language sent in the body and is independent of the global --locale flag, which only sets the request Accept-Language header.

Every real update sends an idempotency key so a retried request is not applied twice. A key is generated automatically; pass --idempotency-key <key> to supply your own (1-255 visible ASCII bytes). Key values are sensitive: output reports only whether a key is generated or explicit and never prints the value. Use --dry-run to preview the method, path, body fields, and idempotency behavior without resolving credentials or contacting the API.

JSON output is the bare project object with fields id, name, description, url, status, timezone, language, limit, automate, created_at, updated_at. Default JSON without --include-meta has no request, replay, idempotency, or metadata wrapper.

--include-meta adds safe transport context under meta when --json, --jq, or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

Output modes: default human summary, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.

```text
svanja project update <project-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--automate` | project automate flag (sent in the body) |
| `--body` | JSON request body (mutually exclusive with field flags and --body-file) |
| `--body-file` | read the JSON request body from a file, or - for stdin |
| `--description` | project description (sent in the body; --description "" clears it) |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |
| `--language` | project content language (sent in the body; distinct from the global --locale) |
| `--limit` | project resource limit field (sent in the body; not a pagination control) |
| `--name` | project name (sent in the body) |
| `--status` | project status: active, paused, or archived |
| `--timezone` | project timezone (sent in the body; validated by the API) |
| `--url` | project URL (sent in the body) |

```bash
svanja project update <project-id> --name "Renamed"
svanja project update <project-id> --status paused
svanja project update <project-id> --description ""
svanja project update <project-id> --body '{"status":"archived"}'
svanja project update <project-id> --body-file project.json
svanja project update <project-id> --name "Renamed" --dry-run
svanja project update <project-id> --idempotency-key <key> --status paused
svanja project update <project-id> --status paused --json
svanja project update <project-id> --status paused --jq .status
svanja project update <project-id> --status paused --template '{{.id}}'
svanja project update <project-id> --status paused --include-meta --template '{{.meta.request_id}}'
```

### svanja project

Manage projects visible to the active team API key.

List projects with shared pagination and API-authoritative filters, show one by an opaque id, create or update projects, use fixed-status pause, resume, and archive mutations, or delete projects.

```text
svanja project [flags]
```

Works without a key.

```bash
svanja project list
svanja project show <project-id>
svanja project create --name "Demo"
svanja project update <project-id> --status paused
svanja project pause <project-id>
svanja project resume <project-id>
svanja project archive <project-id>
svanja project delete <project-id>
```

### svanja space create

Create a Space.

This command calls POST /spaces on the public Svanja API. The API remains authoritative for validation, access, capabilities, receipts, conflicts and domain-specific failure reasons. Use --query key=value for filters, cursors, pages or operation-specific query fields.

Build the request body with --field key=value, --body '<json>' or --body-file <path>; field flags cannot be combined with body input. Every real mutation sends an idempotency key so a retried request is not applied twice. Pass --idempotency-key <key> to supply your own. Use --dry-run to preview the method, path, query, body fields and idempotency behavior without resolving credentials or contacting the API.

Output modes: default human detail, --plain copy-safe output, --json stable JSON, and --jq/--template transforms over the documented JSON value.

--include-meta adds safe transport context under meta when --json, --jq or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

```text
svanja space create [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--body` | JSON request body (mutually exclusive with --field and --body-file) |
| `--body-file` | read the JSON request body from a file, or - for stdin |
| `--dry-run` | preview the request without resolving credentials or contacting the API |
| `--field` | body field as key=value (repeatable; mutually exclusive with --body and --body-file) |
| `--idempotency-key` | explicit idempotency key (1-255 visible ASCII bytes); generated when omitted |
| `--query` | query parameter as key=value (repeatable) |

```bash
svanja space create --field name="Website relaunch" --field kind=project --field language=en-US
svanja space create --field name="Halden Logistics" --field kind=client --field new_company_name="Halden Logistics" --field language=de-DE
```

### svanja space list

List Spaces.

This command calls GET /spaces on the public Svanja API. The API remains authoritative for validation, access, capabilities, receipts, conflicts and domain-specific failure reasons. Use --query key=value for filters, cursors, pages or operation-specific query fields.

Output modes: default human detail, --plain copy-safe output, --json stable JSON, and --jq/--template transforms over the documented JSON value.

--include-meta adds safe transport context under meta when --json, --jq or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

```text
svanja space list [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--query` | query parameter as key=value (repeatable) |

```bash
svanja space list --json
svanja space list --plain
svanja space list --jq .
svanja space list --template '{{.}}'
svanja space list --json --include-meta
```

### svanja space show

Show a Space.

This command calls GET /spaces/{space} on the public Svanja API. The API remains authoritative for validation, access, capabilities, receipts, conflicts and domain-specific failure reasons. Use --query key=value for filters, cursors, pages or operation-specific query fields.

Output modes: default human detail, --plain copy-safe output, --json stable JSON, and --jq/--template transforms over the documented JSON value.

--include-meta adds safe transport context under meta when --json, --jq or --template is selected. The ordinary value moves under data; output without --include-meta remains unchanged. It cannot be combined with --dry-run.

```text
svanja space show <space-id> [flags]
```

Needs a stored key (svanja login) or SVANJA_API_KEY.

| Flag | What it does |
| --- | --- |
| `--query` | query parameter as key=value (repeatable) |

```bash
svanja space show <space-id> --json
svanja space show <space-id> --plain
svanja space show <space-id> --jq .
svanja space show <space-id> --template '{{.}}'
svanja space show <space-id> --json --include-meta
```

### svanja space

Manage Spaces and Git handoffs.

Use this family to call native Svanja public API operations with the active team API key. The server owns validation, access checks, authorization, receipts and domain-specific behavior; the CLI supplies product identity, explicit arguments, stable output modes and safe local request handling.

```text
svanja space [flags]
```

Works without a key.

```bash
svanja space --help
```
