figura-cli 0.8.0 → 0.8.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.
- package/dist/index.js +1 -1
- package/dist/mcp.js +27 -27
- package/package.json +1 -1
- package/skills/figura-fig/SKILL.md +13 -1
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ description. Pass --tokens '' (or --description '') to explicitly clear one.
|
|
|
81
81
|
The tokens block is freeform plain text (colors + roles, type, spacing, voice) —
|
|
82
82
|
exactly what the /fig generator reads. Tip: the figura-brand skill writes this for
|
|
83
83
|
you by scanning your repo ("introduce my repo to Figura").`;async function Fd(){let i=[];for await(let a of process.stdin)i.push(Buffer.from(a));return Buffer.concat(i).toString("utf8")}async function Zm(i){if((i[0]&&!i[0].startsWith("-")?i[0]:void 0)==="set")return Sd(i.slice(1));let{flags:n}=j(i);if(N(n,"help")||N(n,"h")){process.stdout.write(Ym+`
|
|
84
|
-
`);return}let{token:c,apiUrl:p}=await O(n),o;try{o=await F("/v1/brand",{token:c,apiUrl:p,source:L})}catch(e){X(_(e))}if(N(n,"json")){T(o);return}let s=[];s.push(`name: ${o.name??""}${o.isCustom?"":" (default)"}`),s.push(`product: ${o.appDescription??""}`),s.push(`tokens: ${(o.tokensBlock??"").length} chars`),process.stdout.write(s.join(`
|
|
84
|
+
`);return}let{token:c,apiUrl:p}=await O(n),o;try{o=await F("/v1/brand",{token:c,apiUrl:p,source:L})}catch(e){X(_(e))}if(N(n,"json")){T(o);return}let s=[];s.push(`name: ${o.name??""}${o.isCustom?"":" (default)"}`),s.push(`product: ${o.appDescription??""}`),s.push(`tokens: ${(o.tokensBlock??"").length} chars`),s.push(`surfaces: ${(o.surfaces??[]).join(", ")||"(none)"}`),s.push(`forbidden: ${(o.forbidden??"").length} chars`),process.stdout.write(s.join(`
|
|
85
85
|
`)+`
|
|
86
86
|
`)}async function Sd(i){let{flags:a}=j(i);if(N(a,"help")||N(a,"h")){process.stdout.write(Ym+`
|
|
87
87
|
`);return}let{token:n,apiUrl:c}=await O(a),p=$(a,"name");if(!p)X("--name is required for `brand set`.");let o={name:p},s=$(a,"description");if(s!==void 0)o.appDescription=s;let e=$(a,"tokens");if(e==="-")o.tokensBlock=await Fd();else if(e&&e.startsWith("@"))try{o.tokensBlock=Ld(e.slice(1),"utf8")}catch(l){X(`could not read --tokens file ${e.slice(1)}: ${_(l)}`)}else if(e!==void 0)o.tokensBlock=e;let m;try{m=await F("/brand",{method:"PUT",body:o,token:n,apiUrl:c,source:L})}catch(l){X(_(l))}if(N(a,"json")){T(m);return}process.stdout.write(`Brand saved: ${m.name}
|