@jawwws/bytes-cli
v0.2.0
Published
Command line interface for the Jawwws Bytes Developer API
Maintainers
Readme
Jawwws Bytes CLI
Command line interface for the Jawwws Bytes Developer API.
Jawwws Bytes helps small teams create, manage and measure short links, QR codes and Offline Engagement from one workspace. The CLI is for people who want to create and manage those links from scripts, deployments and repeatable workflows.
Requirements
- Node.js 24 or newer
- A Jawwws Bytes workspace
- A workspace API key
Install
npm install -g @jawwws/bytes-cliFor local development:
npm install
npm run build
npm linkCreate an API key
API keys are managed inside your Bytes workspace.
Open the app, choose the workspace you want the CLI to use, then go to:
Workspace Settings > Developer APIDirect app link:
https://app.jaww.ws/dashboard/workspace-settings?tab=apiDeveloper API authentication docs:
https://developer.jaww.ws/developer-api/authentication/Keep API keys private. Do not commit them to source control or paste them into tickets, chat or documents.
Authentication
For scripts and CI, use an environment variable. This keeps the key out of your project files.
export BYTES_API_KEY="jwb_live_xxx"Then run commands normally:
bytes tags listFor a local machine you control, you can store the key in the Bytes CLI config:
bytes config set-api-key jwb_live_xxxThe local config path is:
~/.config/jawwws-bytes/config.jsonAPI base URL
The production API base URL is:
https://api.jaww.ws/api/v1For local testing:
BYTES_API_BASE_URL=http://localhost:8000/api/v1 bytes tags listLinks
Create a short link:
bytes links create https://example.com/cops-and-coffee/coffee-tasting \
--slug cops-coffee-tasting \
--title "Cops and Coffee tasting event" \
--channel print \
--utm-source poster \
--utm-medium qr \
--utm-campaign coffee-tasting \
--utm-content poster-v1Expected output:
Short link created
ID: 01K0M4ZN8X7P9Q2R3S4T5V6W7X
Short URL: https://jaww.ws/cops-coffee-tasting
Slug: cops-coffee-tasting
Destination: https://example.com/cops-and-coffee/coffee-tasting
Title: Cops and Coffee tasting event
Status: active
Channel: print
UTM source: poster
UTM medium: qr
UTM campaign: coffee-tasting
UTM content: poster-v1The link id shown by the CLI is an opaque public link ID. It is safe to use in Developer API and CLI commands. It is not the internal database ID.
List links:
bytes links list --per-page 10Search links:
bytes links list --q coffeeShow one link:
bytes links get 01K0M4ZN8X7P9Q2R3S4T5V6W7XUpdate a link:
bytes links update 01K0M4ZN8X7P9Q2R3S4T5V6W7X \
--destination-url https://example.com/cops-and-coffee/new-page \
--title "Updated Cops and Coffee tasting page" \
--utm-content poster-v2Mark a link inactive:
bytes links update 01K0M4ZN8X7P9Q2R3S4T5V6W7X --inactiveArchive a link:
bytes links archive 01K0M4ZN8X7P9Q2R3S4T5V6W7X --yesUse JSON output for scripts:
bytes links list --json
bytes links get 01K0M4ZN8X7P9Q2R3S4T5V6W7X --json
bytes links create https://example.com --slug example --jsonTags
List tags:
bytes tags listCreate a tag:
bytes tags create "Coffee tasting" --slug coffee-tasting --colour "#2563eb"Update a tag:
bytes tags update 01K0M5ABCD7EFGHJKMNPQRSTVW --description "Links for coffee tasting events"Delete a tag:
bytes tags delete 01K0M5ABCD7EFGHJKMNPQRSTVW --yesAttach tags to a link:
bytes links tags attach 01K0M4ZN8X7P9Q2R3S4T5V6W7X --tag-ids 01K0M5ABCD7EFGHJKMNPQRSTVW,01K0M5BCDE8FGHJKMNPQRSTVWXRemove a tag from a link:
bytes links tags detach 01K0M4ZN8X7P9Q2R3S4T5V6W7X 01K0M5ABCD7EFGHJKMNPQRSTVWThe tag id shown by the CLI is an opaque public tag ID. It is safe to use in Developer API and CLI commands and is not the internal database ID.
Supported commands
bytes --help
bytes --version
bytes config show
bytes config set-api-key <api-key>
bytes config clear-api-key
bytes links list
bytes links create <destination-url>
bytes links get <link-id>
bytes links update <link-id>
bytes links archive <link-id> --yes
bytes tags list
bytes tags create <name>
bytes tags update <public-tag-id>
bytes tags delete <public-tag-id>
bytes links tags attach <link-id>
bytes links tags detach <link-id> <public-tag-id>Public API scope
The CLI only uses documented /api/v1 Developer API endpoints.
It does not call:
- browser session routes
- admin APIs
- internal Laravel endpoints
- private dashboard APIs
Development
npm install
npm run typecheck
npm run test
npm run buildRun locally without linking:
npm run dev -- --help
npm run dev -- links create https://example.com --slug example
npm run dev -- links listVerify the package contents before publishing:
npm run release:checkThis runs typecheck, tests, build and npm pack --dry-run.
Documentation
Developer API docs:
https://developer.jaww.ws/developer-api/OpenAPI YAML:
https://developer.jaww.ws/openapi/bytes-developer-api.openapi.yaml