CarbonFiles.Cli 0.2.5

dotnet tool install --global CarbonFiles.Cli --version 0.2.5
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CarbonFiles.Cli --version 0.2.5
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CarbonFiles.Cli&version=0.2.5
                    
nuke :add-package CarbonFiles.Cli --version 0.2.5
                    

CarbonFiles CLI (cf)

A colorful command-line tool for managing CarbonFiles -- buckets, files, API keys, tokens, and more. Built with Spectre.Console for rich terminal output.

Installation

dotnet tool (requires .NET 10)

dotnet tool install -g CarbonFiles.Cli

From source

git clone <repo-url>
cd carbon-cli
dotnet build

Quick Start

# Configure your server
cf config set --url https://files.example.com --token cf4_your_api_key

# Create a bucket
cf bucket create "My Files" -e 7d

# Upload files
cf file upload <bucket-id> ./document.pdf ./image.png

# List your buckets
cf bucket list

# Download a file
cf file download <bucket-id> document.pdf

Command Reference

Command Description
Configuration
cf config set --url <url> --token <token> Configure server connection
cf config show Show current profile configuration
cf config profiles List all saved profiles
cf config use <name> Switch active profile
Buckets
cf bucket list List all buckets
cf bucket create <name> Create a new bucket
cf bucket info <id> Show bucket details
cf bucket update <id> Update a bucket
cf bucket delete <id> Delete a bucket
cf bucket download <id> Download bucket as ZIP
cf bucket watch <id> Watch bucket for live changes via SignalR
Files
cf file list <bucket-id> List files in a bucket
cf file info <bucket-id> <path> Show file details
cf file upload <bucket-id> [paths] Upload files to a bucket
cf file download <bucket-id> <path> Download a file from a bucket
cf file delete <bucket-id> <path> Delete a file
API Keys
cf key list List all API keys
cf key create <name> Create a new API key
cf key delete <prefix> Revoke an API key
cf key usage <prefix> Show API key usage stats
Tokens
cf token create upload <bucket-id> Create an upload token for a bucket
cf token create dashboard Create a dashboard token
cf token info Show current dashboard token info
Short URLs
cf short resolve <code> Resolve a short URL code
cf short delete <code> Delete a short URL
System
cf stats Show system-wide statistics
cf health Check API health status

Configuration

The CLI stores its configuration in ~/.cf/config.json. Configuration is organized into named profiles, allowing you to connect to multiple CarbonFiles servers or use different credentials.

Setting up a profile

# Configure the default profile
cf config set --url https://files.example.com --token cf4_your_api_key

# Create a named profile
cf config set --profile staging --url https://staging.example.com --token cf4_staging_key

Managing profiles

# List all profiles
cf config profiles

# Switch the active profile
cf config use staging

# Show current profile configuration
cf config show

Per-command profile override

Any command accepts the --profile flag to use a specific profile without switching the active one:

cf bucket list --profile staging

Global Options

Flag Description
--json Output raw JSON instead of formatted tables (useful for piping to jq)
--profile <name> Use a specific config profile for this command
--help Show help information
--version Show version information

Examples

Create a bucket with an expiry

cf bucket create "Sprint Demo" -d "Files for the sprint review" -e 7d

Upload a directory recursively

cf file upload abc123 ./build-output/ -r

Pipe content from stdin

echo "Hello, world!" | cf file upload abc123 --stdin -n greeting.txt

Use JSON output with jq

# Get all bucket IDs
cf bucket list --json | jq '.[].id'

# Get the total size of a bucket
cf bucket info abc123 --json | jq '.total_size'

Create an upload token and use it

# Create a token that allows 10 uploads and expires in 1 hour
cf token create upload abc123 -e 1h --max-uploads 10

# Use the token to upload (instead of your API key)
cf file upload abc123 ./photo.jpg --token cfu_the_upload_token

Watch a bucket for live changes

cf bucket watch abc123

This opens a live SignalR connection and streams file created, updated, and deleted events as they happen. Press Ctrl+C to stop.

Download a file to a specific path

cf file download abc123 reports/q4.pdf -o ~/Downloads/q4-report.pdf

Download an entire bucket as a ZIP

cf bucket download abc123

Development

# Build
dotnet build

# Run tests
dotnet test

# Run a CLI command during development
dotnet run --project src/CarbonFiles.Cli -- <command>
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.5 135 3/5/2026
0.2.4 115 3/5/2026
0.2.3 111 3/5/2026
0.2.2 117 3/5/2026
0.2.1 111 3/5/2026
0.2.0 117 3/5/2026
0.1.6 117 3/4/2026
0.1.5 120 3/4/2026
0.1.0 115 3/4/2026