Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ jobs:
run: |
bats \
cli/bash/commands/basectl/tests/*.bats \
cli/bash/commands/caff/tests/caff.bats \
cli/bash/commands/sort-in-place/tests/sort-in-place.bats \
lib/bash/file/tests/lib_file.bats \
lib/bash/git/tests/lib_git.bats \
lib/bash/runtime/tests/runtime_bashrc.bats \
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ and Base versions are tracked in the repo-root `VERSION` file.
default, with explicit `--public` and `--private` visibility flags.
- Updated Base-managed shell profile sections to use shorter `>>> base: ...`
markers, clearer overwrite guidance, and quoted source paths.
- Moved the optional `caff` and `sort-in-place` utility CLIs out of Base and
into `codeforester/base-platform-tools`.

### Fixed

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,17 @@ invoke it from whatever shell state they already had.
Base exposes its own commands through `$BASE_HOME/bin`. That directory is added
to `PATH` by Base's managed shell startup snippets.

`bin/basectl` is the control-plane command. Additional public commands, when
needed, are tiny real launcher files in `bin/` that delegate to `basectl`; their
implementation remains under `cli/bash/commands/<command>/` or, in the future,
`bin/basectl` is the control-plane command. Additional Base-owned public
commands, when needed, are tiny real launcher files in `bin/` that delegate to
`basectl`; their implementation remains under
`cli/bash/commands/<command>/` or, in the future,
`cli/python/commands/<command>/`.

Example launcher:
Example launcher for a hypothetical Base-owned Bash command:

```bash
#!/usr/bin/env bash
exec "$(dirname "$0")/basectl" caff "$@"
exec "$(dirname "$0")/basectl" example "$@"
```

Projects expose their own commands through `$PROJECT_ROOT/bin`. When
Expand Down Expand Up @@ -1017,15 +1018,14 @@ Those defaults are intended to stay conservative:
- prompt defaults
- history behavior

## Bonus Utilities
## Optional Utility Tools

Base currently exposes a small number of convenience utilities through
`$BASE_HOME/bin`, including `caff` and `sort-in-place`. These are useful helper
commands that share Base's command conventions, but they are not the core
workspace orchestration surface.
Base no longer owns general-purpose utility CLIs such as `caff` and
`sort-in-place`. Those tools live in
[`codeforester/base-platform-tools`](https://github.com/codeforester/base-platform-tools),
which is the optional platform/SRE utility layer for Base-managed workspaces.

As Base matures, bonus utilities may stay documented as extras or move behind a
clearer namespace. The control-plane surface remains `basectl`.
The Base control-plane surface remains `basectl`.

## What Base Is Responsible For

Expand Down
9 changes: 5 additions & 4 deletions STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ layer boundaries rather than placing logic wherever it is easiest to call.
`PATH`.

Public commands in `bin/` should be real launcher files, not symlinks. Keep them
small and delegate into the command implementation. For a Bash command:
small and delegate into the command implementation. For a hypothetical Bash
command:

```bash
#!/usr/bin/env bash
exec "$(dirname "$0")/basectl" caff "$@"
exec "$(dirname "$0")/basectl" example "$@"
```

The implementation still belongs under:
Expand Down Expand Up @@ -417,8 +418,8 @@ Base-owned Bash CLIs should live in per-command directories:

```text
cli/bash/commands/
caff/
caff.sh
example/
example.sh
README.md
tests/
```
Expand Down
2 changes: 0 additions & 2 deletions bin/caff

This file was deleted.

2 changes: 0 additions & 2 deletions bin/sort-in-place

This file was deleted.

7 changes: 3 additions & 4 deletions cli/bash/commands/basectl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ The public entrypoint lives at `bin/basectl`. It establishes the Base runtime
for command implementations, then sources this command implementation and calls
`main`.

`basectl` also dispatches direct command names by convention. For example,
`basectl caff` loads `cli/bash/commands/caff/caff.sh`. Public convenience
commands in `$BASE_HOME/bin`, such as `bin/caff`, should remain tiny launchers
that delegate to `basectl`.
`basectl` also dispatches direct Base-owned command names by convention when
such command directories exist. Optional utility CLIs such as `caff` and
`sort-in-place` live in `codeforester/base-platform-tools` instead of Base core.

## Current subcommands

Expand Down
22 changes: 1 addition & 21 deletions cli/bash/commands/basectl/tests/runtime-dispatch.bats
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,8 @@ EOF
[[ "$output" == *"ARGS=-m base_setup --dry-run demo"* ]]
}

@test "basectl dispatches command implementations by command name" {
run_basectl sort-in-place --help

[ "$status" -eq 0 ]
[[ "$output" == *"Sort text files in place."* ]]
}

@test "basectl treats path-like arguments as scripts before command names" {
local script_path="$TEST_TMPDIR/sort-in-place"
local script_path="$TEST_TMPDIR/demo-script"

cat > "$script_path" <<'EOF'
main() {
Expand Down Expand Up @@ -234,16 +227,3 @@ EOF
[[ "$output" == *"declare -rx BASE_BASH_COMMAND_DIR=\"$script_dir\""* ]]
[[ "$output" == *"declare -rx BASE_BASH_COMMAND_SCRIPT=\"$script_dir/inspect-command-env.sh\""* ]]
}

@test "sort-in-place launcher delegates through basectl" {
local input_file="$TEST_TMPDIR/input.txt"

printf 'b\na\nb\n' > "$input_file"
run env \
HOME="$TEST_HOME" \
PATH="$BASE_REPO_ROOT/bin:/usr/bin:/bin:/usr/sbin:/sbin" \
sort-in-place -u "$input_file"

[ "$status" -eq 0 ]
[ "$(cat "$input_file")" = $'a\nb' ]
}
9 changes: 0 additions & 9 deletions cli/bash/commands/caff/README.md

This file was deleted.

136 changes: 0 additions & 136 deletions cli/bash/commands/caff/caff.sh

This file was deleted.

Loading
Loading