Skip to Content
CoworkingView Docs

Command line

@coworkingview/cli: search and read the catalogue from a terminal or a script. Commands, flags, exit codes and JSON output.

@coworkingview/cli is the official command-line client for the public API. It is MIT-licensed, needs Node.js 20 or newer and, like the API, no API key. It only reads.

npx @coworkingview/cli search --city berlin

To keep it installed:

npm install -g @coworkingview/cli
coworkingview cities

Commands

CommandWhat it does
search --city <slug>Lists spaces in a city, one line each with the slug.
get <slug>The full record of one space, as JSON.
citiesEvery city slug you can search.
healthAPI status and deployed version, as JSON.
helpUsage.

coworkingview --version prints the installed version.

Flags

FlagDefaultNotes
--city <slug>noneRequired for search.
--type <t>noneFilter search by workspace type: private_office, exclusive_bereich, fix_desk, flex_desk, day_pass, meeting_room, virtual_office, event_space or membership.
--limit <n>10Results per page. See the note below.
--page <n>1Page number, from 1.
--locale <l>enen, de or es.
--jsonoffJSON output for search and cities. get and health always print JSON.
--versionPrint the version.

--limit above 50

The CLI accepts --limit from 1 to 100, but the API serves at most 50 per page (pageSize, see Pagination). Use 50 or less; a larger value is sent to the API and comes back as a validation error with exit code 1.

A wrong --type or --locale, or a flag written without a value, is rejected locally with the list of valid values, before any request is made. A typo never looks like "no results".

Examples

Private offices in Berlin, 20 per page, as JSON
npx @coworkingview/cli search --city berlin --type private_office --limit 20 --json
One space in German
npx @coworkingview/cli get <slug> --locale de
Titles and starting prices with jq
npx @coworkingview/cli search --city berlin --limit 50 --json \
  | jq -r '.[] | "\(.title)\t\(.fromPrice.amount // "n/a")"'
Walk every page until one comes back empty
page=1
while :; do
  batch=$(npx @coworkingview/cli search --city london --page "$page" --limit 50 --json)
  [ "$(echo "$batch" | jq 'length')" -eq 0 ] && break
  echo "$batch" | jq -c '.[]'
  page=$((page + 1))
done

With --json, search and cities print the API's own records unchanged (the contents of data, without the envelope).

Exit codes and errors

CodeMeaning
0Success.
1API or network error, including no answer within 15 seconds.
2Usage error: a missing or malformed flag or command. Nothing was sent.

Output goes to stdout; diagnostics go to stderr, so | jq never receives an error where records were expected. With --json, errors are JSON as well:

stderr
{ "error": { "code": "USAGE", "message": "search requires --city <slug> (e.g. --city berlin)" } }

code is USAGE (exit 2) or API (exit 1). The CLI never prompts and never uses colours or spinners, so it behaves the same in a terminal, a pipe or CI.

When to use something else

The CLI covers search and detail. For filters, market rates, profiles or the map, call the API directly. For an AI assistant, use the MCP server.

On this page