awarts 0.2.9 → 0.3.0
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.
- package/dist/index.js +9 -7
- package/package.json +1 -1
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.
|
|
7411
|
+
program2.name("awarts").description("Track your AI coding spend across Claude, Codex, Gemini & Antigravity").version("0.3.0").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);
|