Open-source CLI for the Nylio public API.
Related docs:
- npm package: nylio-cli
- monorepo integration note:
function/docs/nylio-cli.md
npm install -g nylio-climacOS users can also install a self-contained Bun-compiled binary via Homebrew once a tap formula is published.
nylio --help
nylio documents --help
nylio login
nylio login --print-url
nylio auth status
nylio whoami
nylio workspaces list
nylio documents create --title "Draft"
nylio documents list --limit 10 --offset 0
nylio documents get <document-id-or-url>
nylio documents edit --document <document-id-or-url> --old-string "<oldString>" --new-string "<newString>"
cat replacement.txt | nylio documents edit --document <document-id-or-url> --old-string "<oldString>" --new-string-stdin
nylio documents replace --document <document-id-or-url> --markdown "<full-enhanced-markdown-body>"
cat body.md | nylio documents replace --document <document-id-or-url> --stdin
nylio documents export <document-id-or-url> --format markdown
nylio search "query"Each command and subcommand now supports --help with targeted examples, for example:
nylio documents get --help
nylio documents replace --helpnpm run check:publish-safety
npm run lint
npm run typecheck
npm run build
npm pack --dry-runThe publish safety check fails if the CLI imports server-only code, workspace-internal aliases, or files outside src.
GitHub Actions publishes the package from the Publish CLI workflow when you push a tag in the format nylio-cli-v<version>, for example:
git tag nylio-cli-v0.1.0
git push origin nylio-cli-v0.1.0That same workflow also creates a GitHub Release for the tag and uploads:
nylio-cli-<version>-darwin-arm64.tar.gznylio-cli-<version>-darwin-x64.tar.gzSHA256SUMSnylio.rbfor Homebrew
GitHub Releases are the distribution point for the self-contained macOS binaries. Homebrew should point at those release assets.
Manual local publish is also wired:
npm run publish:npmTo build the macOS release artifacts locally:
npm run release:artifacts -- --repo prodev1000/nylio-cli --tag v0.1.0That writes the archives, checksums, and a generated Homebrew formula to dist/release.
The generated nylio.rb formula is intended for a tap repo and references the GitHub Release assets for the tagged version.
Recommended setup:
- keep
npmas the cross-platform install path - publish macOS Bun binaries to GitHub Releases
- maintain a small Homebrew tap repo that contains the generated
nylio.rb
Once a tap exists, installs look like:
brew tap <owner>/<tap-repo>
brew install nylio--api-base-url <url>overrides the default API origin- default output is compact plain text
--jsonrenders machine-readable JSON outputBETTER_AUTH_URLsets the default API origin when--api-base-urlis not passedNYLIO_OAUTH_CLI_CLIENT_IDoverrides the OAuth client id for custom environments
- Unknown flags fail fast instead of being ignored.
- Write commands accept explicit flags instead of requiring positional-only input.
nylio documents replace --stdinreads the replacement body from stdin.nylio documents edit --old-string-stdinand--new-string-stdinlet you pipe one side of the edit.--dry-runpreviewsdocuments editanddocuments replacerequests without sending them.
The CLI uses OAuth 2.1 Authorization Code + PKCE against the Nylio Better Auth issuer and stores user tokens locally at ~/.config/nylio/auth.json.
Use nylio login --print-url if you do not want the CLI to open a browser automatically.
MIT