awarts 0.2.9 → 0.3.1

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.
@@ -0,0 +1,27 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ **Positive behavior includes:**
10
+ - Using welcoming and inclusive language
11
+ - Being respectful of differing viewpoints
12
+ - Gracefully accepting constructive criticism
13
+ - Focusing on what is best for the community
14
+
15
+ **Unacceptable behavior includes:**
16
+ - Trolling, insulting comments, and personal attacks
17
+ - Harassment in any form
18
+ - Publishing others' private information without permission
19
+ - Other conduct which could reasonably be considered inappropriate
20
+
21
+ ## Enforcement
22
+
23
+ Instances of abusive or unacceptable behavior may be reported by opening an issue or contacting the maintainer. All complaints will be reviewed and investigated.
24
+
25
+ ## Attribution
26
+
27
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,66 @@
1
+ # Contributing to AWARTS CLI
2
+
3
+ Thanks for your interest in contributing to AWARTS! Here's how to get started.
4
+
5
+ ## Development Setup
6
+
7
+ 1. Clone the repo:
8
+ ```bash
9
+ git clone https://github.com/HarshalJain-cs/AWARTS.git
10
+ cd AWARTS/cli
11
+ ```
12
+
13
+ 2. Install dependencies:
14
+ ```bash
15
+ npm install
16
+ ```
17
+
18
+ 3. Run in dev mode:
19
+ ```bash
20
+ npm run dev
21
+ ```
22
+
23
+ ## Project Structure
24
+
25
+ ```
26
+ cli/
27
+ src/
28
+ index.ts # CLI entry point (commander setup)
29
+ types.ts # Shared TypeScript types
30
+ adapters/ # Provider adapters (claude, codex, gemini, antigravity)
31
+ commands/ # Command implementations
32
+ lib/ # Core libraries (auth, daemon, api, output)
33
+ dist/ # Built output
34
+ package.json
35
+ ```
36
+
37
+ ## Adding a New Provider Adapter
38
+
39
+ 1. Create `src/adapters/<provider>.ts` implementing the `Adapter` interface:
40
+ ```typescript
41
+ interface Adapter {
42
+ name: ProviderKey;
43
+ displayName: string;
44
+ detect(): Promise<boolean>;
45
+ read(): Promise<UsageEntry[]>;
46
+ }
47
+ ```
48
+
49
+ 2. Register it in `src/lib/detect.ts`
50
+
51
+ 3. Test with `awarts push --provider <name> --dry-run`
52
+
53
+ ## Guidelines
54
+
55
+ - Write clear commit messages
56
+ - Keep PRs focused on a single change
57
+ - Test your changes locally before submitting
58
+ - Don't commit API keys or credentials
59
+
60
+ ## Reporting Issues
61
+
62
+ Open an issue at [github.com/HarshalJain-cs/AWARTS/issues](https://github.com/HarshalJain-cs/AWARTS/issues) with:
63
+ - Node.js version (`node --version`)
64
+ - OS and version
65
+ - Steps to reproduce
66
+ - Expected vs actual behavior
package/SECURITY.md ADDED
@@ -0,0 +1,9 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you discover a security vulnerability, please email **harshaljaincs@gmail.com**.
6
+
7
+ **Do NOT open a public GitHub issue for security vulnerabilities.**
8
+
9
+ See the full security policy at [github.com/HarshalJain-cs/AWARTS/SECURITY.md](https://github.com/HarshalJain-cs/AWARTS/blob/main/SECURITY.md).
package/dist/index.js CHANGED
@@ -6669,7 +6669,7 @@ function hashEntries(entries) {
6669
6669
  }
6670
6670
 
6671
6671
  // src/commands/sync.ts
6672
- async function syncCommand() {
6672
+ async function syncCommand(opts = {}) {
6673
6673
  banner();
6674
6674
  const auth = await loadAuth();
6675
6675
  if (!auth) {
@@ -6749,7 +6749,8 @@ async function syncCommand() {
6749
6749
  const res = await post("/api/usage/submit", {
6750
6750
  entries: cleanEntries,
6751
6751
  source: "cli",
6752
- hash
6752
+ hash,
6753
+ ...opts.note && { note: opts.note }
6753
6754
  });
6754
6755
  if (!res.ok) {
6755
6756
  submitSpin.fail("Sync failed.");
@@ -7007,7 +7008,8 @@ async function pushCommand(opts) {
7007
7008
  const res = await post("/api/usage/submit", {
7008
7009
  entries: cleanEntries,
7009
7010
  source: "cli",
7010
- hash
7011
+ hash,
7012
+ ...opts.note && { note: opts.note }
7011
7013
  });
7012
7014
  if (!res.ok) {
7013
7015
  spin.fail("Submission failed.");
@@ -7406,7 +7408,7 @@ async function checkForUpdates() {
7406
7408
 
7407
7409
  // src/index.ts
7408
7410
  var program2 = new Command;
7409
- program2.name("awarts").description("Track your AI coding spend across Claude, Codex, Gemini & Antigravity").version("0.2.9").hook("preAction", () => checkForUpdates());
7411
+ program2.name("awarts").description("Track your AI coding spend across Claude, Codex, Gemini & Antigravity").version("0.3.1").hook("preAction", () => checkForUpdates());
7410
7412
  program2.command("login").description("Authenticate with your AWARTS account via device auth").option("--force", "Re-authenticate even if already logged in").action(async (opts) => {
7411
7413
  try {
7412
7414
  if (opts.force) {
@@ -7419,7 +7421,7 @@ program2.command("login").description("Authenticate with your AWARTS account via
7419
7421
  process.exit(1);
7420
7422
  }
7421
7423
  });
7422
- program2.command("push").description("Read local usage data and submit to AWARTS").option("-p, --provider <name>", "Only push data from a specific provider (claude, codex, gemini, antigravity)").option("-n, --dry-run", "Show what would be pushed without submitting").action(async (opts) => {
7424
+ program2.command("push").description("Read local usage data and submit to AWARTS").option("-p, --provider <name>", "Only push data from a specific provider (claude, codex, gemini, antigravity)").option("-n, --dry-run", "Show what would be pushed without submitting").option("--note <text>", "Attach a note/description to today's post").action(async (opts) => {
7423
7425
  try {
7424
7426
  await pushCommand(opts);
7425
7427
  } catch (err) {
@@ -7427,9 +7429,9 @@ program2.command("push").description("Read local usage data and submit to AWARTS
7427
7429
  process.exit(1);
7428
7430
  }
7429
7431
  });
7430
- program2.command("sync").description("Auto-detect all providers and push usage data").action(async () => {
7432
+ program2.command("sync").description("Auto-detect all providers and push usage data").option("--note <text>", "Attach a note/description to today's post").action(async (opts) => {
7431
7433
  try {
7432
- await syncCommand();
7434
+ await syncCommand(opts);
7433
7435
  } catch (err) {
7434
7436
  error(err instanceof Error ? err.message : String(err));
7435
7437
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awarts",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "description": "Track your AI coding across Claude, Codex, Gemini & Antigravity",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,10 @@
34
34
  "files": [
35
35
  "dist",
36
36
  "README.md",
37
- "LICENSE"
37
+ "LICENSE",
38
+ "CONTRIBUTING.md",
39
+ "CODE_OF_CONDUCT.md",
40
+ "SECURITY.md"
38
41
  ],
39
42
  "sideEffects": false,
40
43
  "scripts": {