coding-friend-cli 1.0.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.
Files changed (61) hide show
  1. package/dist/chunk-6CGGT2FD.js +32 -0
  2. package/dist/chunk-6DUFTBTO.js +14 -0
  3. package/dist/chunk-AQXTNLQD.js +39 -0
  4. package/dist/chunk-HRVSKMNA.js +31 -0
  5. package/dist/chunk-IUTXHCP7.js +28 -0
  6. package/dist/chunk-KZT4AFDW.js +44 -0
  7. package/dist/chunk-VHZQ6KEU.js +73 -0
  8. package/dist/host-3GAEZKKJ.js +83 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +34 -0
  11. package/dist/init-ONRXFOZ5.js +431 -0
  12. package/dist/json-2XS56OJY.js +10 -0
  13. package/dist/mcp-LMMIFH4B.js +104 -0
  14. package/dist/postinstall.d.ts +1 -0
  15. package/dist/postinstall.js +8 -0
  16. package/dist/statusline-7D6YU5YM.js +64 -0
  17. package/dist/update-K5PYOB52.js +160 -0
  18. package/lib/learn-host/next-env.d.ts +6 -0
  19. package/lib/learn-host/next.config.ts +9 -0
  20. package/lib/learn-host/package-lock.json +3943 -0
  21. package/lib/learn-host/package.json +31 -0
  22. package/lib/learn-host/postcss.config.mjs +7 -0
  23. package/lib/learn-host/scripts/build-search-index.ts +11 -0
  24. package/lib/learn-host/src/app/[category]/[slug]/page.tsx +61 -0
  25. package/lib/learn-host/src/app/[category]/page.tsx +35 -0
  26. package/lib/learn-host/src/app/globals.css +31 -0
  27. package/lib/learn-host/src/app/layout.tsx +32 -0
  28. package/lib/learn-host/src/app/page.tsx +63 -0
  29. package/lib/learn-host/src/app/search/page.tsx +94 -0
  30. package/lib/learn-host/src/app/search/search-index.json +42 -0
  31. package/lib/learn-host/src/components/Breadcrumbs.tsx +28 -0
  32. package/lib/learn-host/src/components/DocCard.tsx +32 -0
  33. package/lib/learn-host/src/components/MarkdownRenderer.tsx +13 -0
  34. package/lib/learn-host/src/components/MobileNav.tsx +56 -0
  35. package/lib/learn-host/src/components/SearchBar.tsx +36 -0
  36. package/lib/learn-host/src/components/Sidebar.tsx +44 -0
  37. package/lib/learn-host/src/components/TagBadge.tsx +12 -0
  38. package/lib/learn-host/src/components/ThemeToggle.tsx +30 -0
  39. package/lib/learn-host/src/lib/docs.ts +113 -0
  40. package/lib/learn-host/src/lib/search.ts +27 -0
  41. package/lib/learn-host/src/lib/types.ts +31 -0
  42. package/lib/learn-host/tsconfig.json +21 -0
  43. package/lib/learn-mcp/package-lock.json +1829 -0
  44. package/lib/learn-mcp/package.json +24 -0
  45. package/lib/learn-mcp/src/bin/learn-mcp.ts +2 -0
  46. package/lib/learn-mcp/src/index.ts +17 -0
  47. package/lib/learn-mcp/src/lib/docs.ts +199 -0
  48. package/lib/learn-mcp/src/lib/knowledge.ts +95 -0
  49. package/lib/learn-mcp/src/lib/types.ts +36 -0
  50. package/lib/learn-mcp/src/server.ts +22 -0
  51. package/lib/learn-mcp/src/tools/create-doc.ts +29 -0
  52. package/lib/learn-mcp/src/tools/get-review-list.ts +29 -0
  53. package/lib/learn-mcp/src/tools/improve-doc.ts +95 -0
  54. package/lib/learn-mcp/src/tools/list-categories.ts +19 -0
  55. package/lib/learn-mcp/src/tools/list-docs.ts +30 -0
  56. package/lib/learn-mcp/src/tools/read-doc.ts +29 -0
  57. package/lib/learn-mcp/src/tools/search-docs.ts +23 -0
  58. package/lib/learn-mcp/src/tools/track-knowledge.ts +35 -0
  59. package/lib/learn-mcp/src/tools/update-doc.ts +43 -0
  60. package/lib/learn-mcp/tsconfig.json +15 -0
  61. package/package.json +47 -0
@@ -0,0 +1,35 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { trackKnowledge } from "../lib/knowledge.js";
4
+
5
+ export function registerTrackKnowledge(
6
+ server: McpServer,
7
+ docsDir: string,
8
+ ): void {
9
+ server.tool(
10
+ "track-knowledge",
11
+ "Record the user's self-assessment of their understanding of a specific learning doc. Status: 'remembered', 'needs-review', or 'new'.",
12
+ {
13
+ category: z.string().describe("Category folder name"),
14
+ slug: z.string().describe("Doc filename without .md extension"),
15
+ status: z
16
+ .enum(["remembered", "needs-review", "new"])
17
+ .describe("User's self-assessment of knowledge retention"),
18
+ notes: z
19
+ .string()
20
+ .optional()
21
+ .describe("Optional notes about understanding level"),
22
+ },
23
+ async ({ category, slug, status, notes }) => {
24
+ const entry = trackKnowledge(docsDir, category, slug, status, notes);
25
+ return {
26
+ content: [
27
+ {
28
+ type: "text",
29
+ text: JSON.stringify({ tracked: true, entry }, null, 2),
30
+ },
31
+ ],
32
+ };
33
+ },
34
+ );
35
+ }
@@ -0,0 +1,43 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { updateDoc } from "../lib/docs.js";
4
+
5
+ export function registerUpdateDoc(server: McpServer, docsDir: string): void {
6
+ server.tool(
7
+ "update-doc",
8
+ "Update an existing learning doc. Can append content, add tags, or update the title. Content is appended (not replaced).",
9
+ {
10
+ category: z.string().describe("Category folder name"),
11
+ slug: z.string().describe("Doc filename without .md extension"),
12
+ content: z.string().optional().describe("Markdown content to append"),
13
+ tags: z
14
+ .array(z.string())
15
+ .optional()
16
+ .describe("Tags to add (merged with existing)"),
17
+ title: z.string().optional().describe("New title"),
18
+ },
19
+ async ({ category, slug, content, tags, title }) => {
20
+ const filePath = updateDoc(docsDir, category, slug, {
21
+ content,
22
+ tags,
23
+ title,
24
+ });
25
+ if (!filePath) {
26
+ return {
27
+ content: [
28
+ { type: "text", text: `Doc not found: ${category}/${slug}.md` },
29
+ ],
30
+ isError: true,
31
+ };
32
+ }
33
+ return {
34
+ content: [
35
+ {
36
+ type: "text",
37
+ text: JSON.stringify({ path: filePath, updated: true }, null, 2),
38
+ },
39
+ ],
40
+ };
41
+ },
42
+ );
43
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "rootDir": "src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "declaration": true
12
+ },
13
+ "include": ["src"],
14
+ "exclude": ["node_modules", "dist"]
15
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "coding-friend-cli",
3
+ "version": "1.0.0",
4
+ "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
+ "type": "module",
6
+ "bin": {
7
+ "cf": "./dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsup src/index.ts src/postinstall.ts --format esm --dts --clean",
11
+ "postinstall": "node dist/postinstall.js || true",
12
+ "prepublishOnly": "npm run build && node scripts/bundle-libs.js",
13
+ "dev": "tsx src/index.ts"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "lib"
18
+ ],
19
+ "keywords": [
20
+ "coding-friend",
21
+ "cli",
22
+ "learning",
23
+ "mcp",
24
+ "claude"
25
+ ],
26
+ "author": "Anh-Thi Dinh",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/dinhanhthi/coding-friend.git",
31
+ "directory": "cli"
32
+ },
33
+ "engines": {
34
+ "node": ">=18"
35
+ },
36
+ "dependencies": {
37
+ "@inquirer/prompts": "^7.0.0",
38
+ "chalk": "^5.0.0",
39
+ "commander": "^13.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^22.0.0",
43
+ "tsup": "^8.0.0",
44
+ "tsx": "^4.0.0",
45
+ "typescript": "^5.7.0"
46
+ }
47
+ }