@tcampus/cli 0.0.0-stage → 2026.1203.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +199 -2
  3. package/dist/cli.js +106 -0
  4. package/package.json +98 -4
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (c) 2025 Burdenoff Consultancy Services Pvt. Ltd., Timecampus Technologies Pvt. Ltd. and all sister companies.
2
+
3
+ All rights reserved.
4
+
5
+ This software is proprietary and confidential. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited without the express written permission of the copyright holders.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+
9
+ For licensing inquiries, please contact: legal@algoshred.com
package/README.md CHANGED
@@ -1,3 +1,200 @@
1
- # Temporary Holding Version
1
+ # @tcampus/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Command-line interface for Timecampus — time-tracking & productivity management from the terminal.
4
+
5
+ A thin shell over [`@burdenoff/cli-sdk`](https://www.npmjs.com/package/@burdenoff/cli-sdk): all
6
+ command logic lives in shared SDK modules. This package builds the product `CLIContext`, mounts
7
+ the modules the Timecampus surface needs, and wires the Commander program.
8
+
9
+ Talks to the Burdenoff platform via the public GraphQL gateways (global + workspace) with
10
+ dual-token authentication.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ # From npmjs (public)
16
+ npm install -g @tcampus/cli
17
+ # or
18
+ bun add -g @tcampus/cli
19
+ ```
20
+
21
+ ## Authentication
22
+
23
+ All workspace operations require dual-token auth (platform token + workspace token). The
24
+ workspace token is issued automatically when you set a workspace.
25
+
26
+ ### User Authentication (OAuth2 Device Code)
27
+
28
+ Interactive browser-based login.
29
+
30
+ ```bash
31
+ # Login — opens browser for approval
32
+ timecampus auth login
33
+ ```
34
+
35
+ **Production:** The CLI auto-uses `https://graphql.burdenoff.com/global` as the OIDC issuer and
36
+ `burdenoff_cli_timecampus` as the client id. Override per-config or via env vars
37
+ (`TIMECAMPUS_OIDC_ISSUER`, `TIMECAMPUS_WORKSPACE_ENDPOINT`, `TIMECAMPUS_GLOBAL_ENDPOINT`).
38
+
39
+ ### Common Auth Commands
40
+
41
+ ```bash
42
+ timecampus auth status # Check current auth state
43
+ timecampus auth token # Print platform access token
44
+ timecampus auth token --workspace # Print workspace token
45
+ timecampus auth refresh # Force token refresh
46
+ timecampus auth logout # Clear stored tokens
47
+
48
+ timecampus workspace list # List available workspaces
49
+ timecampus workspace current # Show current workspace
50
+ timecampus workspace set <id> # Switch workspace (re-issues token)
51
+ ```
52
+
53
+ Token storage: `~/.config/timecampus-cli/auth.json` (mode 0600).
54
+
55
+ ## Commands
56
+
57
+ The CLI mounts the following `@burdenoff/cli-sdk` module groups:
58
+
59
+ ```
60
+ timecampus auth Authentication (login, logout, status, token, refresh)
61
+ timecampus workspace Workspace context (list, current, set)
62
+ timecampus organizations Organization management
63
+ timecampus tours Product tours
64
+ timecampus rbac Role-based access control
65
+ timecampus timecampus TimeCampus domain (projects, tasks, time-entries,
66
+ meetings, expenses, pomodoro, resource-plans,
67
+ approvals, analytics)
68
+ timecampus sandbox Sandbox script execution
69
+ timecampus tags Tags
70
+ timecampus files Files
71
+ timecampus groups Groups
72
+ timecampus conversations Conversations
73
+ timecampus security Security
74
+ timecampus integrations Integrations
75
+ timecampus channels Channels
76
+ timecampus scheduler Scheduler
77
+ timecampus export Data export
78
+ timecampus notifications Notifications
79
+ timecampus support Support
80
+ timecampus products Products / feature flags
81
+ timecampus billing Billing
82
+ timecampus store Store
83
+ timecampus devportal Developer portal
84
+ timecampus health Health checks
85
+ ```
86
+
87
+ Run `timecampus <command> --help` for subcommand details.
88
+
89
+ ### Quick Examples
90
+
91
+ ```bash
92
+ timecampus auth login
93
+ timecampus workspace set <id>
94
+ timecampus timecampus projects list
95
+ timecampus timecampus time-entries running
96
+ timecampus tags create --key bug --label Bug
97
+ timecampus rbac check <user> read project
98
+ timecampus billing subscriptions list
99
+ timecampus devportal apps list --status PUBLISHED
100
+ ```
101
+
102
+ ### CLI capture
103
+
104
+ After signing in and selecting a workspace, use `timecampus channel connect`
105
+ to bind a CLI capture channel to that workspace. Use `channel list`, `pause`,
106
+ `resume`, or `disconnect` to manage it. These commands are separate from the
107
+ shared `timecampus channels` group.
108
+
109
+ `timecampus capture send session.json` reads a JSON array from a file. Pipe
110
+ the same array to `timecampus capture send -` to use standard input:
111
+
112
+ ```json
113
+ [
114
+ {
115
+ "externalId": "example-session-1",
116
+ "startTime": "2026-11-23T09:00:00Z",
117
+ "endTime": "2026-11-23T09:05:00Z"
118
+ }
119
+ ]
120
+ ```
121
+
122
+ Supply a stable ID for each session. If a response is lost, retry with the
123
+ same IDs. A paused or disconnected channel, or revoked capture consent, makes
124
+ the command exit non-zero. The CLI sends timing data only; it does not read
125
+ shell history or collect command arguments.
126
+
127
+ ## Configuration
128
+
129
+ CLI settings are stored in `~/.config/timecampus-cli/`.
130
+
131
+ **Default endpoints (production):**
132
+ - Workspace gateway: `https://graphqlworkspaces.burdenoff.com/workspaces/graphql`
133
+ - Global gateway: `https://graphql.burdenoff.com/global/graphql`
134
+
135
+ Override per-config or via env vars: `TIMECAMPUS_WORKSPACE_ENDPOINT`,
136
+ `TIMECAMPUS_GLOBAL_ENDPOINT`, `TIMECAMPUS_OIDC_ISSUER`.
137
+
138
+ ## Output Formats
139
+
140
+ All list/get commands support `--format` (`-f`): `json`, `table`, `yaml`.
141
+
142
+ ## Development
143
+
144
+ ### Prerequisites
145
+
146
+ - Bun 1.3.14+
147
+ - Node.js 24.11.0+
148
+ - TypeScript 5.9+
149
+
150
+ ### Setup
151
+
152
+ ```bash
153
+ git clone https://github.com/Algoshred/timecampus-cli.git
154
+ cd timecampus-cli
155
+ bun install
156
+ ```
157
+
158
+ ### Commands
159
+
160
+ ```bash
161
+ bun run dev # Run CLI in dev mode (tsx)
162
+ bun run dev -- --help # Dev mode with args
163
+ bun run build # Compile TypeScript (tsc + tsc-alias)
164
+ bun run type-check # Type checking
165
+ bun run lint # ESLint
166
+ bun run format # Prettier
167
+ bun run sanity # All checks (format + lint + type-check + build)
168
+ bun run start # Run compiled CLI
169
+ ```
170
+
171
+ ### Project Structure
172
+
173
+ ```
174
+ src/
175
+ cli.ts # Entry point — builds CLIContext, mounts SDK modules, runs program
176
+ product-defaults.ts # Timecampus endpoints, OIDC client id, env prefix
177
+ ```
178
+
179
+ All command logic lives in `@burdenoff/cli-sdk` modules. To change behaviour shared across
180
+ product CLIs, edit the SDK (`~/products/cli-sdk/`) and bump the dependency here.
181
+
182
+ ## CI/CD
183
+
184
+ **Every push to main / PRs (CI):** Lint -> Type check -> Build -> CLI smoke (`--help`,
185
+ `--version`). No publish — the gate is green-only.
186
+
187
+ **Release (manual `workflow_dispatch` or CalVer git tag):** Lint -> Type check -> Build ->
188
+ Publish to npmjs (public) -> GitHub Release.
189
+
190
+ Publishing is deliberately gated to the Release workflow; pushes to main do **not**
191
+ auto-publish.
192
+
193
+ CalVer format: `YYYY.MDD.PATCH` (e.g., `2026.626.1`).
194
+
195
+ ## License
196
+
197
+ Proprietary — Burdenoff Consultancy Services Pvt. Ltd.
198
+
199
+ **Author:** Vignesh T.V. (vignesh@burdenoff.com)
200
+ **Repository:** https://github.com/Algoshred/timecampus-cli
package/dist/cli.js ADDED
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/cli.ts
4
+ import { readFileSync } from "fs";
5
+ import { join, dirname } from "path";
6
+ import { fileURLToPath } from "url";
7
+ import { buildContext, createProgram } from "@burdenoff/cli-sdk/core";
8
+ import authModule from "@burdenoff/cli-sdk/modules/auth";
9
+ import workspacesModule from "@burdenoff/cli-sdk/modules/workspaces";
10
+ import organizationsModule from "@burdenoff/cli-sdk/modules/organizations";
11
+ import toursModule from "@burdenoff/cli-sdk/modules/tours";
12
+ import rbacModule from "@burdenoff/cli-sdk/modules/rbac";
13
+ import timecampusModule, { registerCaptureCommands } from "@burdenoff/cli-sdk/modules/timecampus";
14
+ import sandboxModule from "@burdenoff/cli-sdk/modules/sandbox";
15
+ import tagsModule from "@burdenoff/cli-sdk/modules/tags";
16
+ import filesModule from "@burdenoff/cli-sdk/modules/files";
17
+ import groupsModule from "@burdenoff/cli-sdk/modules/groups";
18
+ import conversationsModule from "@burdenoff/cli-sdk/modules/conversations";
19
+ import securityModule from "@burdenoff/cli-sdk/modules/security";
20
+ import integrationsModule from "@burdenoff/cli-sdk/modules/integrations";
21
+ import channelsModule from "@burdenoff/cli-sdk/modules/channels";
22
+ import schedulerModule from "@burdenoff/cli-sdk/modules/scheduler";
23
+ import exportModule from "@burdenoff/cli-sdk/modules/export";
24
+ import notificationsModule from "@burdenoff/cli-sdk/modules/notifications";
25
+ import supportModule from "@burdenoff/cli-sdk/modules/support";
26
+ import productsModule from "@burdenoff/cli-sdk/modules/products";
27
+ import billingModule from "@burdenoff/cli-sdk/modules/billing";
28
+ import storeModule from "@burdenoff/cli-sdk/modules/store";
29
+ import devportalModule from "@burdenoff/cli-sdk/modules/devportal";
30
+ import healthModule from "@burdenoff/cli-sdk/modules/health";
31
+
32
+ // src/product-defaults.ts
33
+ var productDefaults = {
34
+ configDirName: "timecampus-cli",
35
+ oidcClientId: "burdenoff_cli_timecampus",
36
+ oidcIssuerProd: "https://graphql.burdenoff.com/global",
37
+ workspaceEndpointDefault: "https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
38
+ globalEndpointDefault: "https://graphql.burdenoff.com/global/graphql",
39
+ envPrefix: "TIMECAMPUS",
40
+ productOrigins: {
41
+ "graphqlworkspaces.burdenoff.com": "https://app.timecampus.com",
42
+ "alphagraphqlworkspaces.burdenoff.com": "https://alphaapp.timecampus.com"
43
+ }
44
+ };
45
+
46
+ // src/cli.ts
47
+ var __filename2 = fileURLToPath(import.meta.url);
48
+ var __dirname2 = dirname(__filename2);
49
+ var version = "0.0.0-dev";
50
+ try {
51
+ const packageJson = JSON.parse(readFileSync(join(__dirname2, "../package.json"), "utf8"));
52
+ if (packageJson.version)
53
+ version = packageJson.version;
54
+ } catch {}
55
+ var ctx = buildContext({
56
+ productName: "timecampus",
57
+ productVersion: version,
58
+ defaults: productDefaults
59
+ });
60
+ var { program, run } = createProgram(ctx, [
61
+ authModule,
62
+ workspacesModule,
63
+ organizationsModule,
64
+ toursModule,
65
+ rbacModule,
66
+ timecampusModule,
67
+ sandboxModule,
68
+ tagsModule,
69
+ filesModule,
70
+ groupsModule,
71
+ conversationsModule,
72
+ securityModule,
73
+ integrationsModule,
74
+ channelsModule,
75
+ schedulerModule,
76
+ exportModule,
77
+ notificationsModule,
78
+ supportModule,
79
+ productsModule,
80
+ billingModule,
81
+ storeModule,
82
+ devportalModule,
83
+ healthModule
84
+ ], {
85
+ name: "timecampus",
86
+ description: "Timecampus CLI — full timecampus-app surface",
87
+ version,
88
+ helpExamples: [
89
+ "$ timecampus auth login # OAuth2 Device Code login",
90
+ "$ timecampus workspace set <id> # Pick workspace",
91
+ "$ timecampus timecampus projects list # TimeCampus projects",
92
+ "$ timecampus timecampus time-entries running # Active timers",
93
+ "$ timecampus channel connect # Set up CLI capture for this workspace",
94
+ "$ timecampus capture send session.json # Send aggregate session timings",
95
+ "$ timecampus tags create --key bug --label Bug # Tags",
96
+ "$ timecampus rbac check <user> read project # RBAC",
97
+ "$ timecampus products feature-flags list # Feature flags",
98
+ "$ timecampus billing subscriptions list # Billing",
99
+ "$ timecampus devportal apps list --status PUBLISHED",
100
+ "",
101
+ "Configuration: ~/.config/timecampus-cli/",
102
+ "Documentation: https://docs.timecampus.com/developers/cli"
103
+ ]
104
+ });
105
+ registerCaptureCommands(program, ctx, { pluralAlias: false });
106
+ run();
package/package.json CHANGED
@@ -1,6 +1,100 @@
1
1
  {
2
2
  "name": "@tcampus/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2026.1203.2",
4
+ "description": "CLI tool for Timecampus — time-tracking & productivity management",
5
+ "type": "module",
6
+ "private": false,
7
+ "bin": {
8
+ "timecampus": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "bun build src/cli.ts --outdir dist --target node --packages external",
16
+ "dev": "bun --watch src/cli.ts",
17
+ "test": "bun test",
18
+ "test:coverage": "bun test --coverage",
19
+ "lint": "eslint .",
20
+ "format": "bun fmt",
21
+ "format:check": "bun fmt --check",
22
+ "clean": "rm -rf dist coverage junit.xml",
23
+ "sanity": "boff sanity",
24
+ "prepublishOnly": "bun run clean && bun run build",
25
+ "start": "bun dist/cli.js",
26
+ "type:check": "boff gate -- bun check --no-pretty",
27
+ "sanity:force": "boff sanity --force",
28
+ "audit": "bun audit --audit-level=high",
29
+ "lint:fix": "eslint . --fix"
30
+ },
31
+ "keywords": [
32
+ "timecampus",
33
+ "cli",
34
+ "graphql",
35
+ "typescript",
36
+ "time-tracking",
37
+ "productivity"
38
+ ],
39
+ "author": {
40
+ "name": "Vignesh T.V",
41
+ "url": "https://github.com/tvvignesh"
42
+ },
43
+ "license": "UNLICENSED",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/Algoshred/timecampus-cli.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/Algoshred/timecampus-cli/issues"
50
+ },
51
+ "homepage": "https://github.com/Algoshred/timecampus-cli#readme",
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "registry": "https://registry.npmjs.org/"
55
+ },
56
+ "dependencies": {
57
+ "@burdenoff/cli-sdk": "2026.1123.1",
58
+ "commander": "14.0.3",
59
+ "graphql": "16.14.2",
60
+ "graphql-request": "7.4.0"
61
+ },
62
+ "devDependencies": {
63
+ "@burdenoff/toolchain": "2026.1107.14",
64
+ "@types/bun": "^1.4.4",
65
+ "eslint": "^9.39.4",
66
+ "knip": "^6.44.1",
67
+ "typescript": "6.0.3"
68
+ },
69
+ "engines": {
70
+ "node": ">=24.11.0",
71
+ "bun": ">=1.4.4"
72
+ },
73
+ "overrides": {
74
+ "postcss": ">=8.5.26",
75
+ "nanoid": ">=3.3.18",
76
+ "js-yaml": ">=4.3.1 <5.0.0 || >=5.2.2",
77
+ "fast-uri": ">=3.1.5",
78
+ "esbuild": ">=0.28.1",
79
+ "serialize-javascript": ">=7.0.5",
80
+ "diff": ">=8.0.3",
81
+ "hono": ">=4.12.34",
82
+ "@hono/node-server": ">=1.19.15",
83
+ "ip-address": ">=10.3.1"
84
+ },
85
+ "packageManager": "bun@1.4.4",
86
+ "trustedDependencies": [],
87
+ "boff": {
88
+ "type": "cli",
89
+ "sanity": {
90
+ "steps": [
91
+ "format",
92
+ "lint",
93
+ "typecheck",
94
+ "build",
95
+ "test",
96
+ "knip"
97
+ ]
98
+ }
99
+ }
100
+ }