spatie/there-there-cli
There There CLI is a command-line tool to interact with the There There API from your terminal. Log in with workspace profiles, switch defaults, and run commands for tickets: list/search, show, reply/forward, add notes, and update status, assignee, or team.
Installation:
composer global require spatie/there-there-cli
Ensure the global bin directory is in your PATH (verify with composer global config bin-dir --absolute).
First Use Case:
there-there login
~/.config/there-there-cli/profiles.json (or the specified profile file).Quick Command: List tickets to verify connectivity:
there-there tickets:list
there-there --help or there-there <command>:help (e.g., there-there tickets:list --help).~/.config/there-there-cli/ for stored credentials and profiles.Multi-Workspace Management:
there-there login --profile=client1
there-there tickets:list --profile=client2
Ticket Automation:
there-there tickets:list --status=unresolved --limit=10
there-there tickets:create --title="Server Down" --description="..." --priority=high
there-there tickets:update 123 --status=resolved
there-there tickets:update-many --status=in_progress --ids="1,2,3"
Integration with Laravel:
// app/Console/Commands/ProcessTickets.php
public function handle() {
$output = $this->call('there-there', ['tickets:list', '--status=unresolved']);
// Parse output and trigger Laravel logic (e.g., notifications).
}
// app/Listeners/CheckTickets.php
public function handle() {
$tickets = shell_exec('there-there tickets:list --json');
$tickets = json_decode($tickets, true);
foreach ($tickets as $ticket) {
if ($ticket['priority'] === 'critical') {
event(new CriticalTicketAlert($ticket));
}
}
}
Scheduled Tasks:
schedule to run CLI commands periodically (e.g., daily ticket summaries):
// app/Console/Kernel.php
protected function schedule(Schedule $schedule) {
$schedule->command('there-there tickets:list --status=unresolved --json')
->dailyAt('9:00')
->appendOutputTo(storage_path('logs/there-there-tickets.log'));
}
--json flag for programmatic parsing:
there-there tickets:list --status=pending --json | jq '.[] | select(.priority == "high")'
.env and pass them via --token:
there-there tickets:create --token=$THERE_THERE_TOKEN --title="..."
$exitCode = shell_exec('there-there tickets:create --title="Test" 2>&1', $output);
if ($exitCode !== 0) {
throw new \RuntimeException(implode("\n", $output));
}
Profile File Permissions:
~/.config/there-there-cli/profiles.json is writable by your user.chmod 600 ~/.config/there-there-cli/profiles.json if permission errors occur.Token Expiry:
Error: Authentication failed. Please log in again.
there-there login or specify a valid --token.Rate Limiting:
--limit to fetch smaller batches.Output Parsing:
--json for stable parsing.Global Composer Dependencies:
composer global require may not update symlinks correctly.composer global update spatie/there-there-cli or reinstall.-v:
there-there tickets:list -v
--dry-run (if supported) or redirect output to a file:
there-there tickets:create --title="Test" --dry-run > debug.log
Profile File Location:
~/.config/there-there-cli/profiles.json.--profile-file=/custom/path/profiles.json.Token Storage:
profiles.json. Avoid sharing this file.env() or a secrets manager for tokens in scripts.Command Aliases:
there-there t:list for tickets:list), but these may not be documented.there-there without arguments to see all available shorthands.Custom Commands:
bin/there-there-wrapper) that chain commands:
#!/bin/bash
there-there tickets:list --status=$1 | your-custom-parser.sh
// app/Facades/ThereThere.php
public static function listTickets($status = null) {
return json_decode(
shell_exec('there-there tickets:list --status=' . $status . ' --json'),
true
);
}
Webhook Integration:
there-there tickets:create --title="Webhook Test" --description="..." --json
Testing:
expectsJob() or expectsOutput():
$this->artisan('there-there tickets:list --status=unresolved')
->expectsOutput('Ticket ID: 123')
->assertExitCode(0);
How can I help you explore Laravel packages today?