@akshatowo/artifacts
v0.0.7
Published
CLI for publishing and managing Artifacts.
Readme
Artifacts CLI
Command-line tools for uploading, listing, and opening Artifacts.
Requirements
The npm package ships a Bun-targeted executable script. Install Bun before using the CLI:
curl -fsSL https://bun.sh/install | bashInstallation
Install the CLI globally with npm:
npm i -g @akshatowo/artifactsThen verify the command is available:
artifacts --helpAuthentication
Sign in with the device-code flow:
artifacts auth loginThe CLI prints a verification URL and a one-time code. Open the URL, sign in, enter the code, and wait for the CLI to finish.
Check the current signed-in user:
artifacts auth whoamiSign out:
artifacts auth logoutAuthentication is stored locally in:
- macOS/Linux:
~/.config/artifacts/auth.json - Windows:
%APPDATA%\artifacts\auth.json
Upload An Artifact
Upload an HTML artifact:
artifacts upload ./path/to/artifact.htmlOn success, the CLI prints the public artifact URL.
If you omit the path, the CLI prompts for a file:
artifacts uploadList Artifacts
List artifacts owned by the signed-in user:
artifacts lsThe output includes the artifact ID, name, creation time, and update time.
Get An Artifact URL
Print the URL for an artifact by ID:
artifacts get <artifact-id>Example:
artifacts get 0192f2c2-8f0e-7000-9c41-68aaf2f4fd21Share An Artifact
Make an artifact public and print its share link:
artifacts share <artifact-id>Example:
artifacts share 0192f2c2-8f0e-7000-9c41-68aaf2f4fd21Anyone with the printed /s/<artifact-id> link can view the artifact.
Stop sharing an artifact:
artifacts unshare <artifact-id>After unsharing, the public share link stops working.
Configuration
By default, production builds use:
https://artifacts.4kshat.devOverride the API base URL with BASE_URL:
BASE_URL=http://localhost:3000 artifacts lsThe auth device client ID defaults to artifacts-cli. Override it with
AUTH_CLIENT_ID:
AUTH_CLIENT_ID=my-client artifacts auth loginDevelopment
Build the distributable CLI:
bun run buildRun type checking:
bun run check-typesTest the built binary locally:
./dist/index.js --helpPreview the npm package contents:
npm pack --dry-runPublishing
Before publishing, build and type-check:
bun run build
bun run check-typesPublish from this package directory:
npm publish