bamboohr-cli
Version, currently 1.0.22 versions
- 1.0.2latestJul 9, 2025
- 1.0.1not indexedJun 19, 2026
github.com/josacar/bamboohr-cli
A modern, interactive command-line interface for BambooHR time tracking. Features real-time session updates, XDG-compliant configuration, secure credential management with masked input, and professional terminal prompting powered by crystal-term/prompt.
Installation
# Add this to your shard.yml
dependencies:
bamboohr-cli:
github: josacar/bamboohr-cli
version: ~> 1.0.2Then run:
shards installshard.yml
- Crystal
>= 1.0.0- License
- MIT
- Author
- Jose Luis
- Target
bamboohr-clifrom src/bamboohr_cli.cr
Dependencies
Runtime Dependencies
- term-prompt~> 0.2.0github: crystal-term/prompt
Development Dependencies
README
BambooHR Time Tracker CLI
A modern, interactive command-line interface for BambooHR time tracking, built with Crystal. Features real-time session updates, XDG-compliant configuration management, and secure credential storage.
โจ Features
- ๐ Interactive clock in/out functionality
- โฑ๏ธ Real-time display of current session duration (updates every second when clocked in)
- ๐ Live daily total time tracking (includes current session + completed sessions)
- ๐จ Colorized output for better visibility
- ๐ Automatic status updates with periodic API refresh
- ๐ก๏ธ Error handling and network resilience
- ๐ XDG-compliant configuration management with YAML files
- ๐ Secure credential storage with proper file permissions
๐ Quick Start
Prerequisites
- Crystal programming language (>= 1.0.0)
- BambooHR account with API access
- BambooHR API key
Installation
From Source
git clone https://github.com/josacar/bamboohr-cli.git
cd bamboohr-cli
make build
sudo make install # Optional: install to system PATH
Using Shards
# Add to your shard.yml
dependencies:
bamboohr-cli:
github: josacar/bamboohr-cli
version: ~> 1.0.0
First Run
# First run will prompt for configuration
bamboohr-cli
# Output:
๐ง BambooHR CLI Configuration Setup
No configuration file found. Let's set up your BambooHR credentials.
Enter your BambooHR company domain: mycompany
Enter your BambooHR API key: ******
Enter your employee ID: 123
๐พ Save this configuration for future use? [Y/n]: y
๐พ Configuration saved to ~/.config/bamboohr-cli/config.yml
๐ Usage
Interactive Mode
bamboohr-cli
Example Output
๐ฏ BambooHR Time Tracker
Company: mycompany
Employee ID: 12345
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ข CLOCKED IN | Current session: 2h 15m 30s | Daily total: 6h 45m 30s
Press ENTER to clock out (Ctrl+C to exit):
Real-time updates when clocked in:
- Current session time updates every second
- Daily total includes current session + previous sessions
- Live display without interrupting user interaction
Command Line Options
bamboohr-cli --help # Show help information
bamboohr-cli --version # Show version information
bamboohr-cli --config # Show configuration file information
bamboohr-cli --config-remove # Remove saved configuration file
โ๏ธ Configuration
Configuration File Locations
The CLI follows the XDG Base Directory Specification:
- User config:
~/.config/bamboohr-cli/config.yml - System config:
/etc/xdg/bamboohr-cli/config.yml
Configuration Priority
- User configuration file
- System configuration file
- Environment variables
- Interactive prompts (saved to user config)
Environment Variables
export BAMBOOHR_COMPANY="your_company_domain"
export BAMBOOHR_API_KEY="your_api_key"
export BAMBOOHR_EMPLOYEE_ID="your_employee_id"
Configuration File Format
# BambooHR CLI Configuration
# Your BambooHR company domain (e.g., 'mycompany' for mycompany.bamboohr.com)
company_domain: "mycompany"
# Your BambooHR API key (generate from Settings > API Keys in BambooHR)
api_key: "your_api_key_here"
# Your employee ID (found in your BambooHR profile URL)
employee_id: "123"
๐๏ธ Development
Building from Source
# Clone the repository
git clone https://github.com/josacar/bamboohr-cli.git
cd bamboohr-cli
# Install dependencies
shards install
# Build the application
make build
# Run tests
make test
# Build optimized release version
make release
Running Tests
# Run all tests
crystal spec
# Run specific test file
crystal spec spec/bamboohr_api_spec.cr
# Run tests with verbose output
crystal spec --verbose
๐ง API Integration
BambooHR API Endpoints Used
POST /api/v1/time_tracking/employees/{employeeId}/clock_in- Clock inPOST /api/v1/time_tracking/employees/{employeeId}/clock_out- Clock outGET /api/v1/time_tracking/timesheet_entries- Get time entries
Getting Your BambooHR Credentials
- Company Domain: Your BambooHR subdomain (e.g., if your URL is
mycompany.bamboohr.com, usemycompany) - API Key: Generate from Settings > API Keys in your BambooHR admin panel
- Employee ID: Found in your BambooHR profile URL or employee directory
๐ก๏ธ Security
- Secure file permissions: Configuration files created with
0o600(owner-readable only) - No credential exposure: API keys stored in user's private directory
- Input validation: All user input validated and sanitized
- Error handling: Sensitive information not exposed in error messages
๐ Troubleshooting
Common Issues
- "Invalid API key": Verify your API key is correct and has proper permissions
- "Employee not found": Check your employee ID is correct
- "Network error": Check internet connection and BambooHR service status
- "Permission denied": Ensure your API key has time tracking permissions
Debug Information
# Show configuration information
bamboohr-cli --config
# Check file permissions
ls -la ~/.config/bamboohr-cli/
# Verify configuration file content
cat ~/.config/bamboohr-cli/config.yml
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Quick Contribution Guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and add tests
- Ensure tests pass (
make test) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Crystal Language for the excellent programming language
- BambooHR for providing the time tracking API
- XDG Base Directory Specification for configuration standards
๐ Project Stats
- Language: Crystal
- License: MIT
- Platforms: macOS, Linux, Unix-like systems
๐ Links
Made with โค๏ธ and Crystal
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.2- Tagged
- Jul 9, 2025
- Commit
807e1e55d395- Crystal
>= 1.0.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/josacar/bamboohr-cli
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 15, 2026
- Versions
- 2