@aman_asmuei/aman 0.4.0 → 0.5.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.
- package/dist/index.js +70 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,8 +32,8 @@ function detectPlatform(cwd) {
|
|
|
32
32
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
33
33
|
const parsed = JSON.parse(raw);
|
|
34
34
|
if (typeof parsed.platform === "string") {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
35
|
+
const p6 = parsed.platform;
|
|
36
|
+
if (p6 === "claude-code" || p6 === "cursor" || p6 === "windsurf") return p6;
|
|
37
37
|
}
|
|
38
38
|
} catch {
|
|
39
39
|
}
|
|
@@ -959,9 +959,75 @@ async function showcaseCommand(nameArg, opts = {}) {
|
|
|
959
959
|
p4.outro(`${pc4.green("\u2713")} ${entry.title} is ready!`);
|
|
960
960
|
}
|
|
961
961
|
|
|
962
|
+
// src/commands/here.ts
|
|
963
|
+
import * as p5 from "@clack/prompts";
|
|
964
|
+
import pc5 from "picocolors";
|
|
965
|
+
import fs7 from "fs";
|
|
966
|
+
import path5 from "path";
|
|
967
|
+
async function hereCommand(opts = {}) {
|
|
968
|
+
const cwd = process.cwd();
|
|
969
|
+
const acoreDir = path5.join(cwd, ".acore");
|
|
970
|
+
const contextPath = path5.join(acoreDir, "context.md");
|
|
971
|
+
const configPath = path5.join(acoreDir, "config.json");
|
|
972
|
+
if (fs7.existsSync(contextPath) && !opts.force) {
|
|
973
|
+
p5.intro(pc5.bold("aman here") + " \u2014 project context card");
|
|
974
|
+
const overwrite = await p5.confirm({
|
|
975
|
+
message: `${pc5.dim(".acore/context.md")} already exists. Overwrite?`,
|
|
976
|
+
initialValue: false
|
|
977
|
+
});
|
|
978
|
+
if (p5.isCancel(overwrite) || overwrite === false) {
|
|
979
|
+
p5.outro(pc5.yellow("Skipped. Use --force to overwrite without prompt."));
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
const stack = detectStack() || "unknown";
|
|
984
|
+
const platform = detectPlatform();
|
|
985
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
986
|
+
fs7.mkdirSync(acoreDir, { recursive: true });
|
|
987
|
+
const contextContent = `## Work
|
|
988
|
+
- Stack: ${stack}
|
|
989
|
+
- Domain:
|
|
990
|
+
- Focus:
|
|
991
|
+
|
|
992
|
+
## Session
|
|
993
|
+
- Last updated: ${today}
|
|
994
|
+
- Resume: [starting fresh]
|
|
995
|
+
- Active topics: []
|
|
996
|
+
- Recent decisions: []
|
|
997
|
+
- Temp notes: []
|
|
998
|
+
|
|
999
|
+
## Project Patterns
|
|
1000
|
+
- [observations specific to this project \u2014 built over time]
|
|
1001
|
+
`;
|
|
1002
|
+
fs7.writeFileSync(contextPath, contextContent, "utf-8");
|
|
1003
|
+
if (fs7.existsSync(configPath)) {
|
|
1004
|
+
try {
|
|
1005
|
+
const existing = JSON.parse(fs7.readFileSync(configPath, "utf-8"));
|
|
1006
|
+
if (typeof existing.platform !== "string" || existing.platform === "") {
|
|
1007
|
+
existing.platform = platform || "other";
|
|
1008
|
+
fs7.writeFileSync(configPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
|
|
1009
|
+
}
|
|
1010
|
+
} catch {
|
|
1011
|
+
const fresh = { platform: platform || "other" };
|
|
1012
|
+
fs7.writeFileSync(configPath, JSON.stringify(fresh, null, 2) + "\n", "utf-8");
|
|
1013
|
+
}
|
|
1014
|
+
} else {
|
|
1015
|
+
const fresh = { platform: platform || "other" };
|
|
1016
|
+
fs7.writeFileSync(configPath, JSON.stringify(fresh, null, 2) + "\n", "utf-8");
|
|
1017
|
+
}
|
|
1018
|
+
if (opts.force) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
p5.intro(pc5.bold("aman here") + " \u2014 project context card");
|
|
1022
|
+
p5.log.success(`Wrote ${pc5.dim(".acore/context.md")} (stack: ${stack})`);
|
|
1023
|
+
p5.log.info("Edit it as you work. It is read by aman-claude-code on every session start,");
|
|
1024
|
+
p5.log.info(`and embedded into copilot-instructions.md when you run ${pc5.bold("aman-copilot init")}.`);
|
|
1025
|
+
p5.outro(pc5.green("Done."));
|
|
1026
|
+
}
|
|
1027
|
+
|
|
962
1028
|
// src/index.ts
|
|
963
1029
|
var program = new Command();
|
|
964
|
-
program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.
|
|
1030
|
+
program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.5.0").action(() => {
|
|
965
1031
|
const ecosystem = detectEcosystem();
|
|
966
1032
|
if (ecosystem.acore.installed) {
|
|
967
1033
|
statusCommand();
|
|
@@ -975,4 +1041,5 @@ program.command("deploy").description("Deploy your AI companion (Docker, systemd
|
|
|
975
1041
|
program.command("showcase [name]").description("Set up a showcase AI companion (rutin, kedai, monitor, ...)").option("--dry-run", "preview files without installing").option("--list", "list all available showcases").action(
|
|
976
1042
|
(name, opts) => showcaseCommand(name, opts)
|
|
977
1043
|
);
|
|
1044
|
+
program.command("here").description("Write a project context card (.acore/context.md) for the current directory").option("--force", "overwrite existing card without prompt").action((opts) => hereCommand(opts));
|
|
978
1045
|
program.parse();
|