@openfort/cli 0.1.9 → 0.1.10

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/dist/cli.js +65 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ function base64url(buffer) {
30
30
  function generateState() {
31
31
  return base64url(randomBytes(16));
32
32
  }
33
- function callbackPage(title, description, variant = "success") {
33
+ function callbackPage(title, description, variant = "success", extraHtml = "") {
34
34
  const iconColor = variant === "success" ? "hsl(142 71% 45%)" : "hsl(0 84% 60%)";
35
35
  const icon = variant === "success" ? `<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="${iconColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>` : `<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="${iconColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>`;
36
36
  return `<!DOCTYPE html>
@@ -76,7 +76,7 @@ function callbackPage(title, description, variant = "success") {
76
76
  border: 1px solid var(--border);
77
77
  border-radius: var(--radius);
78
78
  width: 100%;
79
- max-width: 28rem;
79
+ max-width: 33rem;
80
80
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
81
81
  }
82
82
  .card-header {
@@ -99,6 +99,57 @@ function callbackPage(title, description, variant = "success") {
99
99
  color: var(--muted-foreground);
100
100
  line-height: 1.5;
101
101
  }
102
+ .card-extra {
103
+ padding: 0 1.5rem 1.5rem;
104
+ border-top: 1px solid var(--border);
105
+ margin-top: 0;
106
+ }
107
+ .card-extra-title {
108
+ font-size: 0.875rem;
109
+ font-weight: 500;
110
+ margin-top: 1rem;
111
+ margin-bottom: 0.5rem;
112
+ }
113
+ .code-block {
114
+ display: flex;
115
+ align-items: center;
116
+ gap: 0.5rem;
117
+ background-color: var(--border);
118
+ border-radius: var(--radius);
119
+ padding: 0.5rem 0.75rem;
120
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
121
+ font-size: 0.75rem;
122
+ line-height: 1.5;
123
+ overflow-x: auto;
124
+ }
125
+ .code-block code {
126
+ flex: 1;
127
+ word-break: break-all;
128
+ }
129
+ .code-block button {
130
+ flex-shrink: 0;
131
+ background: none;
132
+ border: none;
133
+ color: var(--muted-foreground);
134
+ cursor: pointer;
135
+ padding: 0.25rem;
136
+ display: flex;
137
+ align-items: center;
138
+ }
139
+ .code-block button:hover {
140
+ color: var(--foreground);
141
+ }
142
+ .card-extra-link {
143
+ display: inline-block;
144
+ margin-top: 0.75rem;
145
+ font-size: 0.8rem;
146
+ color: var(--muted-foreground);
147
+ text-decoration: underline;
148
+ text-underline-offset: 2px;
149
+ }
150
+ .card-extra-link:hover {
151
+ color: var(--foreground);
152
+ }
102
153
  </style>
103
154
  </head>
104
155
  <body>
@@ -107,7 +158,7 @@ function callbackPage(title, description, variant = "success") {
107
158
  <div class="card-icon">${icon}</div>
108
159
  <h1 class="card-title">${title}</h1>
109
160
  <p class="card-description">${description}</p>
110
- </div>
161
+ </div>${extraHtml}
111
162
  </div>
112
163
  </body>
113
164
  </html>`;
@@ -142,7 +193,17 @@ function waitForCallback(port, state) {
142
193
  return;
143
194
  }
144
195
  res.writeHead(200, { "Content-Type": "text/html" });
145
- res.end(callbackPage("Login successful!", "You can close this window and return to your terminal."));
196
+ const skillCommand = "npx skills add openfort-xyz/agent-skills --skill openfort";
197
+ const agentSkillHtml = `
198
+ <div class="card-extra">
199
+ <p class="card-extra-title">Build with AI? Add the Openfort skill:</p>
200
+ <div class="code-block">
201
+ <code>${skillCommand}</code>
202
+ <button onclick="navigator.clipboard.writeText('${skillCommand}');this.innerHTML='<svg width=&quot;14&quot; height=&quot;14&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;><polyline points=&quot;20 6 9 17 4 12&quot;/></svg>';setTimeout(()=>this.innerHTML='<svg width=&quot;14&quot; height=&quot;14&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;><rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;13&quot; height=&quot;13&quot; rx=&quot;2&quot; ry=&quot;2&quot;/><path d=&quot;M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1&quot;/></svg>',2000)"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></button>
203
+ </div>
204
+ <a class="card-extra-link" href="https://www.openfort.io/docs/overview/building-with-cli" target="_blank" rel="noopener noreferrer">Learn more about building with the CLI</a>
205
+ </div>`;
206
+ res.end(callbackPage("Login successful!", "You can close this window and return to your terminal.", "success", agentSkillHtml));
146
207
  clearTimeout(timeout);
147
208
  server.close();
148
209
  resolve({ apiKey, publishableKey: publishableKey || void 0, projectId: projectId || void 0, project: project || "unknown" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Openfort CLI — manage wallets, policies, and transactions from the terminal.",
5
5
  "author": "Openfort (https://www.openfort.io)",
6
6
  "bugs": "https://github.com/openfort-xyz/cli/issues",