Repository navigation
Releases
Releases · nohead-io/nohead-cli
v0.5.0
Immutable
release. Only release title and notes can be modified.
--helpends with a link to the CLI's docs, for every command.nohead webhooks create --published-onlycreates a webhook that sends only
changes to published content: no drafts, schedules or edits to unpublished
records.nohead webhooks listmarks such webhooks with
(published only)after their events.- Runs on
@nohead/sdk0.12.0.
v0.4.1
- Runs on
@nohead/sdk0.9.0: a redirect from the API is an error that
says to check the API's address, never followed with your key, and a
slow response that keeps arriving no longer times out.
v0.4.0
BROWSER=nonekeepsnohead loginfrom opening a browser: it only
prints the page to open, as over SSH.nohead loginsigns you in with the browser, at a terminal or run by a
coding agent (no terminal and nothing on stdin). It prints a code, then
opens the web app (or, over SSH or without a display, prints the page to
open), where you check the code and choose the project, the key's scopes
and its expiry; the CLI waits for you to choose Allow and saves the new
key for that project, as a piped key is saved. In a folder that uses a
project (--project,NOHEAD_PROJECTor anohead.json), it asks for a
key for that project, the only one the page then offers. Approving another
sign-in from the same machine for the same project replaces the key: the
CLI saves the new one, and the earlier one is revoked. The code and the
page go to stderr even with--json; stdout carries the same result as
for a piped key. A key piped in (echo "$KEY" | nohead login) is checked
and saved as before, replacing the saved key without revoking it. When
stdin is left open with nothing on it (ssh host nohead loginwithout
-t), it says on stderr after a second that it is waiting for a key
there.- Breaking:
nohead loginat a terminal no longer asks you to paste an
API key: it signs you in with the browser. To save a key you already
have, pipe it in. With nothing on stdin it signs in with the browser too;
something piped in that holds no key (an unset variable in
echo "$KEY") still fails with exit code 2, and so does a login with no
key in CI (CIset), which can't wait for a browser. - Breaking: API keys are saved by project, and profiles are gone:
--profileandNOHEAD_PROFILEno longer exist. An API key belongs to
one project, so choosing a project now chooses its saved key: a command
works in--project, elseNOHEAD_PROJECT, else the project in the
nearestnohead.json(in the current folder or one above it), else the
project of the only saved key. With keys saved for several projects and
none chosen, a command exits 2 and lists them.nohead loginsaves a key
for its project next to other projects' keys (a new key for the same
project replaces the old one) and says which project it saved;
nohead logoutforgets the key of the project in use. Keys saved as
profiles by earlier versions keep working: each is read as its project's
key, and the config file is saved in the new shape the next time it
changes.NOHEAD_API_KEYstill wins over saved keys, in its own project
(or--project, orNOHEAD_PROJECT);nohead.jsondoesn't apply to it.
With--json,loginprintsreplaced(whether it replaced a saved
key) instead ofprofile, andlogoutprintsproject_idinstead. nohead link <project>writesnohead.jsonin the current folder,
{ "project": "prj_..." }, so commands run there or below use that
project and its saved key. It holds no secret: commit it. Linking a
folder that has one replaces its project and keeps anything else in it.nohead whoamisays which project is in use and where it came from
(--project,NOHEAD_PROJECT, anohead.jsonand its path, the only
saved key, orNOHEAD_API_KEY), and names a folder'snohead.jsonthat
something else overrides; with--json, inproject_id,
project_source,link_fileandunused_link_file.nohead loginsays when the key's project isn't the one the folder (or
--project,NOHEAD_PROJECT) uses.--api-urlis no longer in--help: there is one API,
https://api.nohead.io. It andNOHEAD_API_URLstill work, for a local
or test API.- Every list command pages:
collections list,collections history,
fields list,migrations list,webhooks list,webhooks deliveries
andauditstopped at the first 100 (audit: its--limit) without
saying there were more. Likerecords list, they now end with
More: --cursor <cursor>when there are, and take--limit,--cursor
and--all(every page).records historytakes--alltoo, and
assets listtakes--limit.--allreads 100 to a page whatever the
command's default page size. A--limitthat is not a positive integer
is refused before any request, bysearchtoo. - Commands that take a field key (
fields update,fields delete,
fields restore,fields migrate) find a field in a collection with
more than 100 fields; they looked in the first 100 only. - An empty environment variable counts as unset, as in the SDKs: an empty
NOHEAD_API_KEY,NOHEAD_API_URLorNOHEAD_PROJECT(say,
NOHEAD_API_KEY=in an.envrc) no longer hides the saved key, and an emptyXDG_CONFIG_HOMEno longer moves the
config file into the current directory. - A list page that says there is more but gives no cursor no longer ends
withMore: --cursor null; like the SDKs, the CLI stops there. - With
--json, usage errors (a missing argument, an unknown command or
option) print the error envelope on stderr, as other errors do, such as
{ "error": { "type": "invalid_request", "message": "missing required argument 'id'" } },
instead of commander's message and the command's help. They still exit 2. - Options and arguments with a fixed set of values (
records list,
records bulkandrecords export--status, therecords bulk
action,records scheduled --sort,assets url --fitand--format,
webhooks deliveries --status) list their choices in--help, and refuse
any other value as other usage errors do, with a new message such as
option '--fit <fit>' argument 'crop' is invalid. Allowed choices are contain, cover, fill.
assets urlchecks--fitand--formatbefore any request, and
webhooks deliveries --statusbefore the API sees it. Flags that cannot
go together (fields update --required --optional, and in
fields migratealso--multiple --singleand--backfill --backfill-json)
say so in the same way:option '--optional' cannot be used with option '--required'. assets downloadandexport --include-filestreat storage that cannot
be reached like the API: they exit 3 withnetwork_error(it was exit 4,
Unexpected error). A download gives up after the time an upload of the
file may take (a minute, longer for a large file), with the same error.- Numbers and field types given to a command are checked before it makes
any request, with the same messages:fields migrate --type,
--max-length,--minand--maxonfields updateand
fields migrate(which looked the field up first), andassets url
--width,--heightand--quality(which read the asset first). An
empty--if-revision ""is refused as not a positive integer; it was
ignored, so the write went ahead unguarded. importchecksassets.jsonl(with--include-filesexports) along
with the records and drafts, and lists its problems (a line without an
asset ID, the file missing) in the sameincomplete or damagederror
instead of stopping at the first.
v0.3.0
nohead assets downloadandnohead export --include-filesfetch files
from the asset'sfile_url(the API's download links are gone), on
@nohead/sdk0.8.0. Breaking:assets downloadnow saves a deleted
asset's file too, until it is purged (it was refused withdeleted); an
asset whose upload was never completed has no file, and exits 1 with
not_uploaded.
v0.2.0
-
nohead assets list --search <words>finds assets whose filename or alt
text has every word, and--kind image,videolists only assets of those
kinds (image,video,audio,documentorother).--allfollows
every page, and--cursorcontinues from one: without them the list ends
at 100 with the cursor for the next page, asrecords listdoes. -
Breaking (for scripts):
nohead --versionalso prints the SDK version
it calls the API through, such as0.2.0 (SDK 0.7.0). The CLI's own version stays
the first word; a script that compares the whole output should read that
word instead (nohead --version | cut -d" " -f1).
v0.1.0
The first release.
- Install with
npm install -g @nohead/cli, or runnpx nohead. It talks to
https://api.nohead.iounless--api-urlorNOHEAD_API_URLsays
otherwise. nohead login(named profiles; at a terminal it reads the key without
echoing it),whoami,health.- Collections, fields, migrations, records (history, revision, diff, revert,
bulk, import/export as JSON Lines), drafts (create, update, merge now or on
a schedule, discard), assets (assets update --filename --altrenames one
and sets its alt text), search, webhooks, audit. - Schema as code (
schema pull,diff,push) and project export/import,
drafts and assets' alt text included. A push puts fields in the file's
order with one reorder, after adding new ones. --jsonoutput, stable exit codes (0-4), retries for rate limits and
transient failures.assets url <id>builds a rendition URL from the image'simage_url, with
no request for it;--jsonprints{ "url": ... }.collections create --public-searchand
collections update --[no-]public-searchinclude a collection in public
search or remove it;collections search-indexshows the index's name. Schema files carry it
(public_search: true), so schema push and project export/import keep it.