@axiomatic-labs/claudeflow 2.0.66 → 2.0.68

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 (2) hide show
  1. package/bin/cli.js +39 -12
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -80,22 +80,49 @@ async function downloadBinary(token) {
80
80
  }
81
81
 
82
82
  async function ensureBinary() {
83
- if (fs.existsSync(BIN_PATH)) {
84
- return; // Binary exists
83
+ if (!fs.existsSync(BIN_PATH)) {
84
+ // First run — interactive auth + download
85
+ const ui = require('../lib/ui.js');
86
+ const { requireAuth } = require('../lib/auth.js');
87
+ ui.banner();
88
+ ui.step('First run — downloading Claudeflow binary...');
89
+
90
+ const token = await requireAuth();
91
+ try {
92
+ await downloadBinary(token);
93
+ } catch (err) {
94
+ ui.error('Could not download Claudeflow binary.');
95
+ ui.info('Ensure your token has access to the axiomatic-labs/axiomatic-cli repository.');
96
+ process.exit(1);
97
+ }
98
+ return;
85
99
  }
86
100
 
87
- const ui = require('../lib/ui.js');
88
- const { requireAuth } = require('../lib/auth.js');
89
- ui.banner();
90
- ui.step('First run — downloading Claudeflow binary...');
91
-
92
- const token = await requireAuth();
101
+ // Binary exists — check for updates silently
93
102
  try {
103
+ const { getGitHubToken } = require('../lib/auth.js');
104
+ const token = getGitHubToken();
105
+ if (!token) return; // No cached token, skip check
106
+
107
+ const installed = fs.existsSync(VERSION_PATH)
108
+ ? fs.readFileSync(VERSION_PATH, 'utf-8').trim()
109
+ : null;
110
+
111
+ const releaseData = await fetchUrl(
112
+ `https://api.github.com/repos/${OWNER}/${REPO}/releases/latest`,
113
+ { Authorization: `Bearer ${token}`, Accept: 'application/vnd.github+json' }
114
+ );
115
+ const release = JSON.parse(releaseData.toString());
116
+ const latest = release.tag_name;
117
+
118
+ if (installed && installed === latest) return; // Already up to date
119
+
120
+ const ui = require('../lib/ui.js');
121
+ ui.banner();
122
+ ui.step(`Updating binary to ${latest}...`);
94
123
  await downloadBinary(token);
95
- } catch (err) {
96
- ui.error('Could not download Claudeflow binary.');
97
- ui.info('Ensure your token has access to the axiomatic-labs/axiomatic-cli repository.');
98
- process.exit(1);
124
+ } catch {
125
+ // Network/API error skip silently, use existing binary
99
126
  }
100
127
  }
101
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiomatic-labs/claudeflow",
3
- "version": "2.0.66",
3
+ "version": "2.0.68",
4
4
  "description": "Claudeflow — AI-powered development toolkit for Claude Code. Skills, agents, hooks, and quality gates that ship production apps.",
5
5
  "bin": {
6
6
  "claudeflow": "./bin/cli.js"