The foundation CLI tool for shelltime.xyz - a platform for tracking DevOps work.
curl -sSL https://raw.githubusercontent.com/malamtime/installation/master/install.bash | bash
The CLI stores its configuration in $HOME/.shelltime/config.toml
.
Field | Type | Default | Description |
---|---|---|---|
token |
string | "" |
Your authentication token for shelltime.xyz |
apiEndpoint |
string | "https://api.shelltime.xyz" |
The API endpoint URL for shelltime.xyz |
webEndpoint |
string | "https://shelltime.xyz" |
The web interface URL for shelltime.xyz |
flushCount |
integer | 10 |
Number of records to accumulate before syncing to server |
gcTime |
integer | 14 |
Number of days to keep tracked data before garbage collection |
dataMasking |
boolean | true |
Enable/disable masking of sensitive data in tracked commands |
enableMetrics |
boolean | false |
Enable detailed command metrics tracking (WARNING: May impact performance) |
endpoints |
array | [] |
Additional API endpoints for development or testing |
Example configuration:
token = "your-token-here"
apiEndpoint = "https://api.shelltime.xyz"
webEndpoint = "https://shelltime.xyz"
flushCount = 10
gcTime = 14
dataMasking = true
enableMetrics = false
enableMetrics
to true
will track detailed metrics for every command execution. Only enable this when requested by developers for debugging purposes, as it may impact shell performance.
shelltime auth [--token <your-token>]
Initializes the CLI with your shelltime.xyz authentication token. This command needs to be run before using other features.
Options:
--token
: Your personal access token from shelltime.xyz. if omit, you can also redirect to website to auth
Example:
shelltime auth --token abc123xyz
shelltime track [options]
Tracks your shells activities and sends them to shelltime.xyz.
Options:
- TODO: List track command options
Example:
shelltime track # TODO: Add example
shelltime sync
Manually triggers synchronization of locally tracked commands to the shelltime.xyz server. This command can be useful when:
- You want to force an immediate sync without waiting for the automatic sync threshold
- You're troubleshooting data synchronization issues
- You need to ensure all local data is uploaded before system maintenance
Example:
shelltime sync
There are no additional options for this command as it simply processes and uploads any pending tracked commands according to your configuration settings.
shelltime gc [options]
Performs cleanup of old tracking data and temporary files.
Options:
- TODO: List GC command options
Example:
shelltime gc # TODO: Add example
The standard command saving process performs efficiently as it only involves file I/O operations. Testing on a MacBook Pro M1-Pro (14-inch) with 1TB storage shows consistent write latencies under 8ms, which should not impact your daily operations.
Server synchronization times can vary significantly based on your geographical location:
- Users in Southeast Asia (near Singapore servers): ~100ms
- Users in other regions: May experience longer latency
If you experience slower synchronization times due to your location, we recommend:
- Increasing the
FlushCount
value in~/.shelltime/config.toml
to accumulate more commands before syncing - Manually running
shelltime sync
during off-peak hours
Example configuration for users in regions far from Singapore:
FlushCount = 100 # Increased from default 10
This configuration reduces the frequency of automatic syncs while ensuring your command history is still preserved locally.
Use shelltime --version
or shelltime -v
to display the current version of the CLI.
a client daemon service that could process request from cli and sync to server
To install the service:
For Linux (systemd):
- Copy the binary to
/usr/local/bin/shelltime-daemon
- Copy
shelltime.service
to/etc/systemd/system/
- Run:
sudo systemctl daemon-reload
sudo systemctl enable shelltime
sudo systemctl start shelltime
For macOS:
- Copy the binary to
/usr/local/bin/shelltime-daemon
- Copy
xyz.shelltime.daemon.plist
to/Library/LaunchDaemons/
- Run:
sudo launchctl load /Library/LaunchDaemons/xyz.shelltime.daemon.plist
This implementation provides:
- A daemon service that listens on a Unix domain socket
- Handling of status and track messages
- Proper shutdown handling
- Service description files for both Linux and macOS
- Basic logging
- JSON message format for communication
You can extend the handleStatus
and handleTrack
functions to implement the specific functionality you need for each command.
For support, please contact: [email protected]
Copyright (c) 2024 shelltime.xyz Team