1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
"use strict";(globalThis.webpackChunkproject_public_docs=globalThis.webpackChunkproject_public_docs||[]).push([[331],{8453(e,n,i){i.d(n,{R:()=>o,x:()=>c});var l=i(6540);const t={},s=l.createContext(t);function o(e){const n=l.useContext(s);return l.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),l.createElement(s.Provider,{value:n},e.children)}},9499(e,n,i){i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>r});const l=JSON.parse('{"id":"reference/collections","title":"CmdForge Collections","description":"Collections are curated groups of tools that can be installed together with a single command.","source":"@site/docs/reference/collections.md","sourceDirName":"reference","slug":"/reference/collections","permalink":"/rob/CmdForge/reference/collections","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_label":"Collections","sidebar_position":3,"format":"md"},"sidebar":"docs","previous":{"title":"Meta-Tools","permalink":"/rob/CmdForge/reference/meta-tools"},"next":{"title":"Example Tools","permalink":"/rob/CmdForge/reference/examples"}}');var t=i(4848),s=i(8453);const o={sidebar_label:"Collections",sidebar_position:3,format:"md"},c="CmdForge Collections",d={},r=[{value:"Implementation Status",id:"implementation-status",level:2},{value:"Use Cases",id:"use-cases",level:2},{value:"CLI Usage",id:"cli-usage",level:2},{value:"List Collections",id:"list-collections",level:3},{value:"View Collection Details",id:"view-collection-details",level:3},{value:"Install Collection",id:"install-collection",level:3},{value:"Admin Management",id:"admin-management",level:2},{value:"Admin UI Features",id:"admin-ui-features",level:3},{value:"Admin API Endpoints",id:"admin-api-endpoints",level:3},{value:"Creating a Collection via API",id:"creating-a-collection-via-api",level:3},{value:"Public API Endpoints",id:"public-api-endpoints",level:2},{value:"List Response",id:"list-response",level:3},{value:"Detail Response",id:"detail-response",level:3},{value:"Database Schema",id:"database-schema",level:2},{value:"Collection Manifest Format",id:"collection-manifest-format",level:2},{value:"Web UI",id:"web-ui",level:2},{value:"Implementation Files",id:"implementation-files",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"cmdforge-collections",children:"CmdForge Collections"})}),"\n",(0,t.jsx)(n.p,{children:"Collections are curated groups of tools that can be installed together with a single command."}),"\n",(0,t.jsx)(n.h2,{id:"implementation-status",children:"Implementation Status"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Feature"}),(0,t.jsx)(n.th,{children:"Status"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Public API endpoints"}),(0,t.jsx)(n.td,{children:"Done"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Admin API endpoints"}),(0,t.jsx)(n.td,{children:"Done"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Web UI browse pages"}),(0,t.jsx)(n.td,{children:"Done"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Admin management UI"}),(0,t.jsx)(n.td,{children:"Done"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Database schema"}),(0,t.jsx)(n.td,{children:"Done"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"CLI commands"}),(0,t.jsx)(n.td,{children:"Done"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Registry repo sync"}),(0,t.jsx)(n.td,{children:"Not implemented"})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"use-cases",children:"Use Cases"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Thematic bundles"}),': "writing-toolkit" with grammar, tone, simplify tools']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Application stacks"}),': "data-science" with json-extract, csv-insights, etc.']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Source bundles"}),': "fabric-text" with all Fabric text processing patterns']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Workflow packages"}),": Tools that work well together for a specific task"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"cli-usage",children:"CLI Usage"}),"\n",(0,t.jsx)(n.h3,{id:"list-collections",children:"List Collections"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# List available collections\ncmdforge collections list\n\n# List in JSON format\ncmdforge collections list --json\n"})}),"\n",(0,t.jsx)(n.p,{children:"Example output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Available collections (1):\n\n development-hub\n Development-Hub\n Collection of tools for the development-hub application.\n Tools: 2\n\nInstall a collection with: cmdforge collections install <name>\n"})}),"\n",(0,t.jsx)(n.h3,{id:"view-collection-details",children:"View Collection Details"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# View collection details\ncmdforge collections info development-hub\n\n# View in JSON format\ncmdforge collections info development-hub --json\n"})}),"\n",(0,t.jsx)(n.p,{children:"Example output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Development-Hub\n==================================================\n\nCollection of tools for the development-hub application.\n\nMaintainer: official\nTags: Development, Coding, Programming\n\nTools (2):\n - rob/audit-goals\n - rob/realign-goals\n\nInstall all: cmdforge collections install development-hub\n"})}),"\n",(0,t.jsx)(n.h3,{id:"install-collection",children:"Install Collection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Install all tools in a collection\ncmdforge collections install development-hub\n\n# Install with pinned versions from collection\ncmdforge collections install development-hub --pinned\n"})}),"\n",(0,t.jsx)(n.p,{children:"Example output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Installing collection: Development-Hub\nTools to install: 2\n\n Installing rob/audit-goals... v1.0.0\n Installing rob/realign-goals... v1.0.0\n\nInstalled: 2/2\n\nCollection 'development-hub' installed successfully!\n"})}),"\n",(0,t.jsx)(n.h2,{id:"admin-management",children:"Admin Management"}),"\n",(0,t.jsxs)(n.p,{children:["Collections are managed via the admin dashboard at ",(0,t.jsx)(n.code,{children:"/dashboard/admin/collections"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"admin-ui-features",children:"Admin UI Features"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"List collections"}),": View all collections with tool counts and tags"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Create collection"}),": Add new collection with name, display name, description, tools"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Edit collection"}),": Update existing collection details and tool list"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Delete collection"}),": Remove a collection (does not uninstall tools)"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"admin-api-endpoints",children:"Admin API Endpoints"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Method"}),(0,t.jsx)(n.th,{children:"Endpoint"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"GET"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"/api/v1/admin/collections"})}),(0,t.jsx)(n.td,{children:"List all collections (admin)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"POST"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"/api/v1/admin/collections"})}),(0,t.jsx)(n.td,{children:"Create collection (admin)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"PUT"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"/api/v1/admin/collections/:name"})}),(0,t.jsx)(n.td,{children:"Update collection (admin)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"DELETE"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"/api/v1/admin/collections/:name"})}),(0,t.jsx)(n.td,{children:"Delete collection (admin)"})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"creating-a-collection-via-api",children:"Creating a Collection via API"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'curl -X POST https://cmdforge.brrd.tech/api/v1/admin/collections \\\n -H "Authorization: Bearer <admin-token>" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "name": "writing-toolkit",\n "display_name": "Writing Toolkit",\n "description": "Essential tools for writers",\n "maintainer": "official",\n "tools": ["official/fix-grammar", "official/simplify"],\n "pinned": {"official/fix-grammar": "1.0.0"},\n "tags": ["writing", "editing"]\n }\'\n'})}),"\n",(0,t.jsx)(n.h2,{id:"public-api-endpoints",children:"Public API Endpoints"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Method"}),(0,t.jsx)(n.th,{children:"Endpoint"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"GET"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"/api/v1/collections"})}),(0,t.jsx)(n.td,{children:"List all collections (summary)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"GET"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"/api/v1/collections/:name"})}),(0,t.jsx)(n.td,{children:"Get collection details with tool info"})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"list-response",children:"List Response"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "data": [\n {\n "name": "writing-toolkit",\n "display_name": "Writing Toolkit",\n "description": "Essential tools for writers",\n "maintainer": "official",\n "icon": "pencil",\n "tags": ["writing", "editing"],\n "tool_count": 5\n }\n ]\n}\n'})}),"\n",(0,t.jsx)(n.h3,{id:"detail-response",children:"Detail Response"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "data": {\n "name": "writing-toolkit",\n "display_name": "Writing Toolkit",\n "description": "Essential tools for writers",\n "maintainer": "official",\n "icon": "pencil",\n "tags": ["writing", "editing"],\n "tools": [\n {\n "owner": "official",\n "name": "fix-grammar",\n "version": "1.0.0",\n "description": "Fix grammar issues in text",\n "category": "Writing",\n "downloads": 150,\n "pinned_version": "1.0.0"\n }\n ]\n }\n}\n'})}),"\n",(0,t.jsx)(n.h2,{id:"database-schema",children:"Database Schema"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sql",children:"CREATE TABLE collections (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT UNIQUE NOT NULL,\n display_name TEXT NOT NULL,\n description TEXT,\n icon TEXT,\n maintainer TEXT NOT NULL,\n tools TEXT NOT NULL, -- JSON array of tool refs\n pinned TEXT, -- JSON object of version constraints\n tags TEXT, -- JSON array\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n\nCREATE INDEX idx_collections_name ON collections(name);\nCREATE INDEX idx_collections_maintainer ON collections(maintainer);\n"})}),"\n",(0,t.jsx)(n.h2,{id:"collection-manifest-format",children:"Collection Manifest Format"}),"\n",(0,t.jsx)(n.p,{children:"For reference, collections can be defined in YAML format:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'# collections/writing-toolkit.yaml\nname: writing-toolkit\ndisplay_name: Writing Toolkit\ndescription: Essential tools for writers and editors\nicon: pencil # Optional icon identifier\nmaintainer: official # Publisher who maintains this collection\n\ntools:\n - official/fix-grammar\n - official/simplify\n - official/tone-shift\n - official/expand\n - official/proofread\n\n# Optional: version constraints\npinned:\n official/fix-grammar: "1.0.0"\n\ntags:\n - writing\n - editing\n - grammar\n'})}),"\n",(0,t.jsx)(n.h2,{id:"web-ui",children:"Web UI"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"/collections"})," - Browse all collections"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"/collections/:name"})," - Collection detail page with tool grid"]}),"\n",(0,t.jsx)(n.li,{children:"Install button that shows CLI command"}),"\n",(0,t.jsx)(n.li,{children:"Filter by tag, maintainer"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"implementation-files",children:"Implementation Files"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Component"}),(0,t.jsx)(n.th,{children:"File"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"CLI commands"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"src/cmdforge/cli/collections_commands.py"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Registry client"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"src/cmdforge/registry_client.py"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"API endpoints"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"src/cmdforge/registry/app.py"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Admin templates"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"src/cmdforge/web/templates/admin/collections.html"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Admin form"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"src/cmdforge/web/templates/admin/collection_form.html"})})]})]})]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}}}]); |