Activity Commands
The teactl activity commands track and monitor participant activity in training environments. You can view command history, watch activity in real-time, and export data for assessment or auditing.
teactl activity list
List activity events for an environment.
teactl activity list <env> [flags] Flags
| Flag | Description |
|---|---|
--participant <id> | Filter by participant |
--type <type> | Filter by event type |
--since <duration> | Events since duration (e.g., 1h, 30m) |
--limit <n> | Maximum events (default: 100) |
--output <format> | Output format (table, json, yaml) |
Examples
# List recent activity
teactl activity list march-seminar
# Filter by participant
teactl activity list march-seminar --participant participant-3
# Filter by event type
teactl activity list march-seminar --type git-push
# Events from last hour
teactl activity list march-seminar --since 1h Sample output:
$ teactl activity list march-seminar
TIME PARTICIPANT TYPE COMMAND/EVENT STATUS
10:45:23 participant-3 kubectl kubectl apply -f deployment.yaml ✓
10:44:15 participant-1 git-push git push origin main ✓
10:43:42 participant-7 docker docker build -t app:latest . ✓
10:42:30 participant-3 kubectl kubectl get pods ✓
10:41:55 participant-2 shell vim deployment.yaml ✓
10:40:12 participant-5 kubectl kubectl delete pod nginx ✗
10:39:45 participant-1 git git commit -m "fix config" ✓
Showing 7 of 234 events. Use --limit to show more. Event Types
| Type | Description |
|---|---|
kubectl | Kubernetes commands |
git | Git operations (commit, branch, etc.) |
git-push | Git push events |
git-pull | Git pull/fetch events |
docker | Docker commands |
shell | Shell commands |
pipeline | CI/CD pipeline events |
login | Session login events |
logout | Session logout events |
teactl activity get
Show detailed information about an activity event.
teactl activity get <id> [flags] Examples
teactl activity get evt_abc123 Sample output:
$ teactl activity get evt_abc123
Event ID: evt_abc123
Environment: march-seminar
Participant: participant-3
Type: kubectl
Timestamp: 2024-01-15 10:45:23 UTC
Command:
kubectl apply -f deployment.yaml
Working Directory: /home/participant/project
Namespace: participant-3
Exit Code: 0
Duration: 1.2s
Output:
deployment.apps/nginx configured
service/nginx unchanged
Resources Affected:
- deployment/nginx (updated) teactl activity watch
Watch activity in real-time with the TUI viewer.
teactl activity watch <env> [flags] Flags
| Flag | Description |
|---|---|
--participant <id> | Filter by participant |
--type <type> | Filter by event type |
--detail | Start in detailed view mode |
Examples
# Watch all activity
teactl activity watch march-seminar
# Watch specific participant
teactl activity watch march-seminar --participant participant-3
# Start in detailed view
teactl activity watch march-seminar --detail Simple View (Default)
┌─[ Activity Watch: march-seminar ]───────────────────────────────────────────┐
│ Participant: [All ▼] Type: [All ▼] [●] Live │
├─────────────────────────────────────────────────────────────────────────────┤
│ 10:45:23 participant-3 kubectl apply -f deployment.yaml ✓ │
│ 10:44:15 participant-1 git push origin main ✓ │
│ 10:43:42 participant-7 docker build -t app:latest . ✓ │
│ 10:42:30 participant-3 kubectl get pods ✓ │
│ 10:41:55 participant-2 vim deployment.yaml ✓ │
│ 10:40:12 participant-5 kubectl delete pod nginx ✗ │
│ 10:39:45 participant-1 git commit -m "fix config" ✓ │
│ │
├─────────────────────────────────────────────────────────────────────────────┤
│ v:toggle-detail f:filter p:pause x:export q:quit │
└─────────────────────────────────────────────────────────────────────────────┘ Detailed View (Press v to Toggle)
┌─[ Activity Watch: march-seminar ]───────────────────────────────────────────┐
│ Participant: [All ▼] Type: [All ▼] [●] Live [Detailed] │
├─────────────────────────────────────────────────────────────────────────────┤
│ ┌─ participant-3 ─────────────────────────────────────────────────────────┐ │
│ │ 10:45:23 kubectl apply -f deployment.yaml │ │
│ │ namespace: participant-3 │ duration: 1.2s │ exit: 0 ✓ │ │
│ │ resources: deployment/nginx configured │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
│ ┌─ participant-1 ─────────────────────────────────────────────────────────┐ │
│ │ 10:44:15 git push origin main │ │
│ │ repo: sample-app │ branch: main │ commits: 2 │ │
│ │ +45 -12 lines across 3 files │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────────────┤
│ v:toggle-detail f:filter p:pause x:export q:quit │
└─────────────────────────────────────────────────────────────────────────────┘ Watch Keyboard Shortcuts
| Key | Action |
|---|---|
v | Toggle simple/detailed view |
f | Open filter dialog |
p | Pause/resume live updates |
x | Export visible events |
/ | Search events |
Enter | View event details |
q | Quit |
teactl activity export
Export activity data for reporting or assessment.
teactl activity export <env> [flags] Flags
| Flag | Description |
|---|---|
--format <format> | Export format: csv, json |
--output <file> | Output file (default: stdout) |
--participant <id> | Filter by participant |
--type <type> | Filter by event type |
--since <duration> | Events since duration |
--until <timestamp> | Events until timestamp |
Examples
# Export as CSV
teactl activity export march-seminar --format csv --output activity.csv
# Export specific participant's activity
teactl activity export march-seminar
--participant participant-3
--format json
--output participant-3-activity.json
# Export time range
teactl activity export march-seminar
--since 2h
--format csv
--output last-2-hours.csv CSV output format:
timestamp,participant,type,command,exit_code,duration_ms,namespace,details
2024-01-15T10:45:23Z,participant-3,kubectl,kubectl apply -f deployment.yaml,0,1200,participant-3,deployment.apps/nginx configured
2024-01-15T10:44:15Z,participant-1,git-push,git push origin main,0,3400,participant-1,2 commits pushed JSON output format:
{
"environment": "march-seminar",
"exported_at": "2024-01-15T11:00:00Z",
"events": [
{
"id": "evt_abc123",
"timestamp": "2024-01-15T10:45:23Z",
"participant": "participant-3",
"type": "kubectl",
"command": "kubectl apply -f deployment.yaml",
"exit_code": 0,
"duration_ms": 1200,
"namespace": "participant-3",
"details": {
"resources_affected": ["deployment/nginx"]
}
}
]
} Activity Statistics
teactl activity stats
Show activity statistics for an environment.
teactl activity stats <env> [flags] Flags
| Flag | Description |
|---|---|
--since <duration> | Statistics since duration |
--by <grouping> | Group by: participant, type, hour |
Examples
# Overall statistics
teactl activity stats march-seminar
# Statistics by participant
teactl activity stats march-seminar --by participant
# Last 2 hours by type
teactl activity stats march-seminar --since 2h --by type Sample output:
$ teactl activity stats march-seminar
Activity Statistics for 'march-seminar'
Time period: Last 24 hours
Total Events: 1,234
Unique Participants: 15
Success Rate: 94.2%
By Type:
TYPE COUNT SUCCESS AVG DURATION
kubectl 456 97.8% 0.8s
git 234 99.5% 1.2s
git-push 89 100% 2.4s
docker 178 88.2% 15.3s
shell 277 100% n/a
By Hour:
HOUR EVENTS
09:00 45
10:00 123 ████████
11:00 156 ██████████
12:00 78 █████
13:00 134 ████████
14:00 189 ████████████
15:00 201 █████████████
Most Active Participants:
1. participant-3 (234 events)
2. participant-1 (198 events)
3. participant-7 (187 events) Common Workflows
Monitor Training Progress
# Watch all activity live
teactl activity watch march-seminar
# Check who's fallen behind
teactl activity stats march-seminar --by participant Assessment and Grading
# Export participant activity
teactl activity export march-seminar
--participant participant-5
--format json
--output participant-5.json
# Export all activity for the day
teactl activity export march-seminar
--since 8h
--format csv
--output day1-activity.csv Troubleshooting Participant Issues
# View participant's recent activity
teactl activity list march-seminar
--participant participant-7
--since 30m
# Check for errors
teactl activity list march-seminar
--participant participant-7
--type kubectl | grep "✗" Compliance and Auditing
# Full activity export for records
teactl activity export march-seminar
--format json
--output march-seminar-full-audit.json
# Include in environment metadata
teactl env get march-seminar --output yaml > march-seminar-metadata.yaml Privacy Considerations
Note
Activity tracking is transparent to participants. They can see their own activity history in the web terminal.
What’s Tracked
- Commands executed in terminals
- Git operations and commits
- Kubernetes commands
- Pipeline executions
- Login/logout events
What’s NOT Tracked
- File contents (only filenames in commands)
- Passwords or secrets
- Private terminal sessions (if disabled)
- Activity outside of tracked systems
Configuring Tracking
In your blueprint:
spec:
tracking:
enabled: true
events:
- kubectl-command
- git-push
- git-pull
- pipeline-run
# Exclude:
# - shell-command (all terminal activity)
retention: 30d Related Commands
- participant - Participant management
- env watch - Watch environment status
- TUI Activity View - Interactive activity viewer