@nuelink/nuelink-cli
v1.2.0
Published
The official Nuelink CLI for automating social media workflows from your terminal. Schedule posts, upload media, manage brands, and integrate Nuelink into scripts, CI/CD pipelines, and AI agents.
Readme
Nuelink CLI
Official command-line interface for the Nuelink Public API.
Published by the Nuelink organization as the scoped npm package @nuelink/nuelink-cli.
Use this CLI to manage brands, collections, automations, channels, media, and posts from local scripts, CI/CD pipelines, and terminal workflows.
Features
- Global auth with local token persistence
- Bearer auth support via flag, env var, or saved config
- JSON output for easy piping into automation
- Built-in timeout support for safer production usage
- Command coverage for key Nuelink Public API resources
Requirements
- Node.js 18.17 or higher
Installation
Global install from npm
npm install -g @nuelink/nuelink-cliRun without global install
npx @nuelink/nuelink-cli --helpQuick Start
1. Save your API key
nuelink-cli --auth YOUR_API_KEY2. Verify auth source
nuelink-cli auth:status3. Make your first request
nuelink-cli meAuthentication Resolution Order
The CLI resolves auth in this order:
- CLI flag:
--auth <api_key> - Environment variable:
NUELINK_API_KEY - Saved config file in your user home
If a key is passed with --auth, it is persisted for future commands.
Clear saved auth
nuelink-cli auth:clearConfig Storage
The token is stored in:
- Windows:
%USERPROFILE%/.nuelink-cli/config.json - macOS/Linux:
$HOME/.nuelink-cli/config.json
The file stores:
{
"apiKey": "..."
}Global Options
-a, --auth <apiKey>: Set and use API key-h, --help: Show help-V, --version: Show version
Commands
Profile
nuelink-cli meAuth
nuelink-cli auth:status
nuelink-cli auth:clearBrands
nuelink-cli brands --per-page 5 --page 1Collections
nuelink-cli collections --brand-id 13493 --per-page 5 --page 1Create collection:
nuelink-cli collections:create \
--brand-id 13493 \
--title "API Brand" \
--description "Collection from CLI" \
--max-republish 5 \
--channels "300294,60112" \
--queues "Mon 10:10,Mon 12:12"Automations
nuelink-cli automations --brand-id 13493Create automation:
nuelink-cli automations:create \
--brand-id 13493 \
--collection-id 720 \
--feed-url "https://www.nasa.gov/rss/dyn/breaking_news.rss" \
--import-as-type IMAGE \
--sub-type RSS \
--title "NASA Breaking News" \
--type FEED \
--dynamic-title "{{title}}" \
--dynamic-body "{title} {link}"Channels
nuelink-cli channels --brand-id 13493 --per-page 5 --page 1Media
List media:
nuelink-cli media --brand-id 13493Upload media:
nuelink-cli media:upload --brand-id 13493 --file ./assets/image.jpgPosts
List posts:
nuelink-cli posts --brand-id 13493 --collection-id 33273Create post from JSON payload file:
nuelink-cli posts:add-json --brand-id 13493 --collection-id 33273 --payload ./post.jsonExample post.json:
{
"title": "CLI Post Title",
"caption": "Post body from CLI",
"publishMode": "DRAFT"
}Create post with CLI options:
nuelink-cli posts:create \
--brand-id 13493 \
--collection-id 33273 \
--title "title here" \
--caption "body here as well" \
--alt "is this fine" \
--link "https://nuelink.com" \
--publish-mode DRAFT \
--post-as-story true \
--comment "this is a comment" \
--comment-delay 30 \
--media-ids "media-id-1" \
--media-urls "https://media.nuelink.com/media/abc" \
--poll-question "what is the new role?" \
--poll-options "iron,dudee" \
--poll-period 3d \
--poll-correct-option-index 1 \
--poll-explanation "iwa ash idir lwaaa7ad" \
--instagram-collab "karim.chamlal" \
--instagram-location-id "abc123" \
--instagram-location-name "bentaib" \
--instagram-trial-reel MANUAL \
--instagram-share-to-feed true \
--facebook-collab "karim.chamlal" \
--facebook-location-id "abc123" \
--facebook-location-name "bentaib" \
--tiktok-send-to-inbox true \
--youtube-tags "tag1,tag2,tag3" \
--youtube-playlists '[{"channelId":"1","playlistIds":["1","2"]}]'Output and Exit Codes
- Successful requests print
OK <METHOD> <PATH>plus JSON response body - Failed requests print HTTP status and response payload when available
- Exit code is non-zero on failure
Environment Variables
NUELINK_API_KEY: API key fallback if not passed via CLI flagNUELINK_TIMEOUT_MS: request timeout in milliseconds (default:30000)
Example:
NUELINK_TIMEOUT_MS=60000 nuelink-cli brandsProduction Usage Patterns
Shell script usage
#!/usr/bin/env bash
set -euo pipefail
export NUELINK_API_KEY="${NUELINK_API_KEY:?NUELINK_API_KEY is required}"
nuelink-cli brands --per-page 10 --page 1
nuelink-cli collections --brand-id 13493 --per-page 10 --page 1CI usage
Store NUELINK_API_KEY as a repository or org secret and run commands in non-interactive jobs.
Development
Install dependencies
npm ciRun tests
npm testPackage validation
npm run check:packRelease Checklist
- Update version in
package.json - Run
npm test - Run
npm run check:pack - Publish with
npm publish --access public
Troubleshooting
Invalid Token
- Run
nuelink-cli auth:statusto confirm active auth source - Re-save your token with
nuelink-cli --auth YOUR_API_KEY - Ensure no stale
NUELINK_API_KEYis overriding your saved config
Request timeout
Increase timeout for slower operations:
NUELINK_TIMEOUT_MS=120000 nuelink-cli media --brand-id 13493Command help
nuelink-cli --help
nuelink-cli help collectionsSecurity Notes
- Treat API keys as secrets
- Do not commit tokens to source control
- Prefer environment-based secrets in CI/CD
License
MIT
Additional Docs
- Contribution guide: CONTRIBUTING.md
- Security policy: SECURITY.md
