Download packages/cli/src/commands/handlers/service/password.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 594 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/cli/src/commands/handlers/service/password.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/cli/src/commands/handlers/service/password.ts
-
curl -L -o password.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/cli/src/commands/handlers/service/password.ts
594 Bytes
| import { EOL } from "os" | |
| import { Option } from "effect" | |
| import * as Effect from "effect/Effect" | |
| import { Commands } from "../../commands" | |
| import { Runtime } from "../../../framework/runtime" | |
| import { Daemon } from "../../../services/daemon" | |
| export default Runtime.handler( | |
| Commands.commands.service.commands.password, | |
| Effect.fn("cli.service.password")(function* (input) { | |
| const daemon = yield* Daemon.Service | |
| const value = Option.getOrUndefined(input.value) | |
| if (value !== undefined) yield* daemon.stop() | |
| process.stdout.write((yield* daemon.password(value)) + EOL) | |
| }), | |
| ) | |