Bitly URL Shortner and Manager
Use the official Bitly API through a local CLI that reads secrets from a local .env file outside the skill folder.
Local secret storage
Store real credentials in a local env file outside the skill folder.
Recommended approaches:
- set
BITLY_ENV_FILEto point at your local env file - or export
BITLY_CLIENT_ID,BITLY_CLIENT_SECRET,BITLY_ACCESS_TOKEN, and optionalBITLY_DEFAULT_GROUP_GUIDdirectly in the shell
The skill does not need secrets embedded inside the published skill folder.
Example env file shape is documented in:
references/env-example.md
Quick start
Validate auth:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py whoami
List groups:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py groups
List recent links:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py bitlinks --limit 10
Search/filter links:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py search --query "etsy" --limit 20 --tag t-shirts
Shorten one URL:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py shorten --long-url "https://example.com/page"
Shorten many URLs from a txt file:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py bulk-shorten --input "C:\path\to\urls.txt" --output "C:\path\to\results.json"
Export links for other workflows:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py export-links --tag t-shirts --format txt --output "C:\path\to\bitly-links.txt"
Inspect a bitlink:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py expand --bitlink "bit.ly/abc123"
Get clicks for a bitlink:
python .\skills\bitly-url-shortner-and-manager\scripts\bitly_manager.py clicks --bitlink "bit.ly/abc123" --unit day --limit 30
Workflow
- Set Bitly credentials in shell environment variables.
- Run
whoamifirst when verifying a new setup. - Use
groupsif you need the correctgroup_guid. - Use
bitlinks,search, and filters to inspect existing links. - Use
shortenorbulk-shortento create new links. - Use
export-linksto hand clean link sets to other tools or skills. - Feed resulting links into
x-post-prepor another social workflow.
Commands
whoami— verify auth and inspect account infogroups— list accessible groupsbitlinks --limit N [--query TEXT]— list recent links in a groupsearch --query TEXT --limit N— search links by textshorten --long-url URL— create a new short linkexpand --bitlink bit.ly/abc123— inspect an existing bitlinkclicks --bitlink bit.ly/abc123— fetch click metricscreate-custom --bitlink bit.ly/abc123 --custom-bitlink yourdomain.com/name— try to create a custom aliasbulk-shorten --input urls.txt— shorten many URLs from a local txt fileexport-links --format json|txt|csv --output file— export filtered link setsenv-template— print or write a local env template
List/search/export commands support filters like:
--tag--domain--contains
Many list-style commands also support --csv for flatter output.
OAuth / callback note
For a local desktop-style setup, use:
http://127.0.0.1:8765/callback
Optionally also add:
http://localhost:8765/callback
Pairing with other skills
This skill pairs naturally with:
x-post-prepfor adding short links into prepared post filesx-posterfor later scheduling or posting those linked posts
Resources
scripts/
bitly_manager.py— local Bitly CLI for account, link, metrics, export, and batch operations
references/
api-notes.md— Bitly endpoint notesenv-example.md— non-secret example of the local env file shape example of the local env file shape