trackfox
v1.0.5
Published
TrackFox Analytics CLI - Add websites to your analytics dashboard from the command line
Maintainers
Readme
trackfox
Official command-line interface for TrackFox Analytics - Add websites to your analytics dashboard directly from your terminal.
Installation
No installation required! Use with npx:
npx trackfox addOr install globally:
npm install -g trackfox
trackfox addUsage
Add a Website
Add a website to your TrackFox analytics dashboard:
npx trackfox addThis will:
- Open your browser for authentication via Google OAuth
- Prompt you for your website domain
- Create the website in your TrackFox account
- Display your tracking script and next steps
Commands
trackfox add- Add a website to your dashboardtrackfox --version- Show CLI versiontrackfox --help- Show help information
Configuration
Environment Variables
TRACKFOX_API_URL- Override the API endpoint (default:https://trackfox.app)TRACKFOX_CALLBACK_PORT- OAuth callback port (default:3456)DEBUG- Enable detailed error messages
Development Mode
To test against a local TrackFox instance:
TRACKFOX_API_URL=http://localhost:3000 npx trackfox addFeatures
✓ Browser OAuth Authentication - Secure Google OAuth flow
✓ Interactive Prompts - User-friendly domain and name input
✓ Domain Validation - Automatic validation and cleaning
✓ Beautiful Output - Colored terminal output with spinners
✓ Error Handling - Clear error messages and recovery steps
✓ Tracking Script - Instant tracking code generation
Requirements
- Node.js 18.0.0 or higher
- A TrackFox account (sign up at trackfox.app)
Example Output
🦊 TrackFox CLI - Add Website
ℹ Starting authentication...
Opening browser for authentication...
If browser doesn't open, visit: https://trackfox.app/api/cli/auth/start?callbackPort=3456
✓ Authenticated!
? Enter your website domain: example.com
? Enter a name for your website: Example
✓ Website created successfully!
┌──────────────────────────────────────────────────────────────────┐
│ ✓ Success! │
│ │
│ Website: Example │
│ Domain: example.com │
│ Website ID: abc123 │
│ │
│ Add this tracking code to your website's <head> tag: │
│ │
│ <script defer src="https://trackfox.app/script.js" │
│ data-website-id="abc123" data-domain="example.com"></script> │
│ │
│ View your analytics at: │
│ https://trackfox.app/dashboard/abc123 │
└──────────────────────────────────────────────────────────────────┘
Next steps:
1. Add the tracking script to your website
2. Visit your dashboard to see analytics
3. Configure goals and funnels in settingsTroubleshooting
Port Already in Use
If port 3456 is already in use:
TRACKFOX_CALLBACK_PORT=8080 npx trackfox addAuthentication Timeout
If authentication times out after 2 minutes, try again and complete the OAuth flow more quickly.
Cannot Connect to API
Ensure you have internet connectivity and TrackFox is accessible:
curl https://trackfox.app/api/healthDomain Already Exists
If you get "Website with this domain already exists", the domain is already registered in your account. Check your dashboard at trackfox.app/dashboard.
Security
- Authentication tokens expire after 5 minutes
- Tokens only allow website creation (limited scope)
- Callback server only accepts localhost connections
- All communication uses HTTPS in production
Support
- Documentation: trackfox.app/docs
- Email: [email protected]
License
MIT License - see LICENSE file for details
Contributing
We welcome contributions! Please see our contributing guidelines.
Made with 💙 by the TrackFox team
