NocoDB CLI — Schema Commands
Imported from the official nocodb/agent-skills CLI. Schema-focused (table / field / view / link / hook). Record-CRUD commands are documented in nocodb-ops/cli-reference if you need them in a dev workflow.
Platform Support
- Linux / macOS:
scripts/nocodb.sh (Bash, requires curl and jq)
- Windows: PowerShell 5.1+
Plan Requirements
- FREE: Base, Table, Field, Filter, Sort, Record, Link, Attachment APIs
- ENTERPRISE (self-hosted or cloud): Workspace + Workspace Collaboration, Base Collaboration, View, Script, Team, API Token, Hook config UI
Setup
export NOCODB_URL="https://your-instance.com" # required for self-hosted
export NOCODB_API_TOKEN="your-api-token"
export NOCODB_VERBOSE=1 # optional — print resolved IDs
Get an API token at NocoDB → Account Settings → API Tokens → Add New Token.
Installation
npx skills add nocodb/agent-skills
Argument Order & ID Prefixes
Commands follow a hierarchical pattern: WORKSPACE → BASE → TABLE → VIEW/FIELD → RECORD.
Pass names (human-readable) or IDs (faster, from NocoDB). Set NOCODB_VERBOSE=1 to see how the CLI resolves a name to an ID.
| Prefix |
Meaning |
w... |
Workspace |
p... |
Base (project) |
m... |
Table (model) |
c... |
Column / field |
vw... |
View |
Schema Quick Reference
# Bases
nc base:list <workspaceId>
nc base:create <workspaceId> '{"title":"New Base"}'
nc base:get <baseId>
nc base:update <baseId> '{"title":"Renamed"}'
nc base:delete <baseId>
# Tables
nc table:list <baseId>
nc table:create <baseId> '{"title":"Customers"}'
nc table:get <baseId> <tableId>
nc table:update <baseId> <tableId> '{"title":"Renamed"}'
nc table:delete <baseId> <tableId>
# Fields
nc field:list <baseId> <tableId>
nc field:get <baseId> <tableId> <columnId>
nc field:create <baseId> <tableId> '{"title":"Phone","type":"PhoneNumber"}'
nc field:update <baseId> <tableId> <columnId> '{"title":"Mobile"}'
nc field:delete <baseId> <tableId> <columnId>
# Views (Enterprise)
nc view:list <baseId> <tableId>
nc view:create:grid <baseId> <tableId> '{"title":"All"}'
nc view:create:kanban <baseId> <tableId> '{"title":"Pipeline","fk_grp_col_id":"<columnId>"}'
nc view:create:gallery <baseId> <tableId> '{"title":"Catalog","fk_cover_image_col_id":"<columnId>"}'
nc view:create:form <baseId> <tableId> '{"title":"Intake"}'
nc view:create:calendar <baseId> <tableId> '{"title":"Schedule","calendar_range":[{"fk_from_column_id":"<columnId>"}]}'
nc view:update <viewId> '{"title":"Renamed"}'
nc view:delete <viewId>
# Sorts & Filters (per view)
nc sort:list <viewId>
nc sort:create <viewId> '{"fk_column_id":"<columnId>","direction":"desc"}'
nc filter:list <viewId>
nc filter:create <viewId> '{"fk_column_id":"<columnId>","comparison_op":"eq","value":"Active"}'
# Webhooks
nc hook:list <baseId> <tableId>
nc hook:create <baseId> <tableId> '<HookV3Create JSON>'
nc hook:update <hookId> '<HookV3Update JSON>'
nc hook:delete <hookId>
See Reference Files
references/base-table-field.md — bases, tables, fields, all 30 supported field types
references/view-filter-sort.md — views, filters, sorts (Enterprise)
references/relations-links.md — link / lookup / rollup setup via CLI
Filter Syntax in CLI
Same (field,operator,value) grammar as MCP queries — see nocodb-ops/skills/cli-reference/references/filter-syntax.md if you need the operator catalog.
Common Pitfalls
| Symptom |
Cause |
Fix |
nc: command not found |
CLI not installed |
npx skills add nocodb/agent-skills |
Error: NOCODB_API_TOKEN is not set |
Token env-var missing |
export NOCODB_API_TOKEN=... |
| 401 Unauthorized |
Token wrong or revoked |
Regenerate in NocoDB → Account Settings → API Tokens |
| 403 Forbidden |
Token lacks permission for that base |
Share the base with the token's user |
Could not resolve name "X" |
Name not unique or wrong scope |
Pass IDs instead of names; or set NOCODB_VERBOSE=1 to see what's being resolved |
Field type X not supported |
Type spelling |
Check field-types.md for canonical names — they're CamelCase, e.g. LinkToAnotherRecord, not link_to_another_record |
Why Use the CLI Over the API
| When |
Use |
| One-off table or field tweak |
CLI |
| Scripted multi-step migration |
API (or shell loop over CLI) |
| Discoverability & verbosity |
CLI with NOCODB_VERBOSE=1 |
| Embedding in another binary |
API |
| Webhook / Hook config |
Either — CLI is faster to type, API gives structured errors |
1---2name: cli-reference3description: NocoDB `nc` CLI reference — schema-focused commands for tables, fields, views, links, hooks. Loaded only on explicit cite. Use when: - "nc CLI commands" - "NocoDB CLI schema commands" - "how do I create a table from the CLI" - "nc field:create reference" - "NocoDB agent-skills CLI"4---56# NocoDB CLI — Schema Commands78Imported from the official `nocodb/agent-skills` CLI. Schema-focused (table / field / view / link / hook). Record-CRUD commands are documented in `nocodb-ops/cli-reference` if you need them in a dev workflow.910## Platform Support1112- **Linux / macOS**: `scripts/nocodb.sh` (Bash, requires `curl` and `jq`)13- **Windows**: PowerShell 5.1+1415## Plan Requirements1617- **FREE**: Base, Table, Field, Filter, Sort, Record, Link, Attachment APIs18- **ENTERPRISE** (self-hosted or cloud): Workspace + Workspace Collaboration, Base Collaboration, View, Script, Team, API Token, Hook config UI1920## Setup2122```bash23export NOCODB_URL="https://your-instance.com" # required for self-hosted24export NOCODB_API_TOKEN="your-api-token"25export NOCODB_VERBOSE=1 # optional — print resolved IDs26```2728Get an API token at NocoDB → Account Settings → API Tokens → Add New Token.2930## Installation3132```bash33npx skills add nocodb/agent-skills34```3536## Argument Order & ID Prefixes3738Commands follow a hierarchical pattern: `WORKSPACE → BASE → TABLE → VIEW/FIELD → RECORD`.3940Pass **names** (human-readable) or **IDs** (faster, from NocoDB). Set `NOCODB_VERBOSE=1` to see how the CLI resolves a name to an ID.4142| Prefix | Meaning |43|--------|---------|44| `w...` | Workspace |45| `p...` | Base (project) |46| `m...` | Table (model) |47| `c...` | Column / field |48| `vw...` | View |4950## Schema Quick Reference5152```bash53# Bases54nc base:list <workspaceId>55nc base:create <workspaceId> '{"title":"New Base"}'56nc base:get <baseId>57nc base:update <baseId> '{"title":"Renamed"}'58nc base:delete <baseId>5960# Tables61nc table:list <baseId>62nc table:create <baseId> '{"title":"Customers"}'63nc table:get <baseId> <tableId>64nc table:update <baseId> <tableId> '{"title":"Renamed"}'65nc table:delete <baseId> <tableId>6667# Fields68nc field:list <baseId> <tableId>69nc field:get <baseId> <tableId> <columnId>70nc field:create <baseId> <tableId> '{"title":"Phone","type":"PhoneNumber"}'71nc field:update <baseId> <tableId> <columnId> '{"title":"Mobile"}'72nc field:delete <baseId> <tableId> <columnId>7374# Views (Enterprise)75nc view:list <baseId> <tableId>76nc view:create:grid <baseId> <tableId> '{"title":"All"}'77nc view:create:kanban <baseId> <tableId> '{"title":"Pipeline","fk_grp_col_id":"<columnId>"}'78nc view:create:gallery <baseId> <tableId> '{"title":"Catalog","fk_cover_image_col_id":"<columnId>"}'79nc view:create:form <baseId> <tableId> '{"title":"Intake"}'80nc view:create:calendar <baseId> <tableId> '{"title":"Schedule","calendar_range":[{"fk_from_column_id":"<columnId>"}]}'81nc view:update <viewId> '{"title":"Renamed"}'82nc view:delete <viewId>8384# Sorts & Filters (per view)85nc sort:list <viewId>86nc sort:create <viewId> '{"fk_column_id":"<columnId>","direction":"desc"}'87nc filter:list <viewId>88nc filter:create <viewId> '{"fk_column_id":"<columnId>","comparison_op":"eq","value":"Active"}'8990# Webhooks91nc hook:list <baseId> <tableId>92nc hook:create <baseId> <tableId> '<HookV3Create JSON>'93nc hook:update <hookId> '<HookV3Update JSON>'94nc hook:delete <hookId>95```9697## See Reference Files9899- **`references/base-table-field.md`** — bases, tables, fields, all 30 supported field types100- **`references/view-filter-sort.md`** — views, filters, sorts (Enterprise)101- **`references/relations-links.md`** — link / lookup / rollup setup via CLI102103## Filter Syntax in CLI104105Same `(field,operator,value)` grammar as MCP queries — see `nocodb-ops/skills/cli-reference/references/filter-syntax.md` if you need the operator catalog.106107## Common Pitfalls108109| Symptom | Cause | Fix |110|---------|-------|-----|111| `nc: command not found` | CLI not installed | `npx skills add nocodb/agent-skills` |112| `Error: NOCODB_API_TOKEN is not set` | Token env-var missing | `export NOCODB_API_TOKEN=...` |113| 401 Unauthorized | Token wrong or revoked | Regenerate in NocoDB → Account Settings → API Tokens |114| 403 Forbidden | Token lacks permission for that base | Share the base with the token's user |115| `Could not resolve name "X"` | Name not unique or wrong scope | Pass IDs instead of names; or set `NOCODB_VERBOSE=1` to see what's being resolved |116| `Field type X not supported` | Type spelling | Check `field-types.md` for canonical names — they're CamelCase, e.g. `LinkToAnotherRecord`, not `link_to_another_record` |117118## Why Use the CLI Over the API119120| When | Use |121|------|-----|122| One-off table or field tweak | CLI |123| Scripted multi-step migration | API (or shell loop over CLI) |124| Discoverability & verbosity | CLI with `NOCODB_VERBOSE=1` |125| Embedding in another binary | API |126| Webhook / Hook config | Either — CLI is faster to type, API gives structured errors |