Skip to content

Introduce --execute option and functionality #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arichiardi
Copy link
Contributor

@arichiardi arichiardi commented May 29, 2025

This patch adds more superpowers to launchpad: it can now launch the first configured :exec-fn (and relative :exec-args).

This behavior is enabled by adding --execute to the command line.

It does it by introducing a brand new execute-steps var containing, among the others, the exec-fn-eval-forms step - the logic for appending the correct :eval-forms.

Note that this is a completely new code path and neither start nrepl nor hooks up the hot reloading facilities.

An example, you can configure an mcp alias (from bhauman/clojure-mcp)
within deps.local.edn like this:

:aliases {:mcp {:extra-deps {org.slf4j/slf4j-nop {:mvn/version "2.0.16"}
                             com.bhauman/clojure-mcp {:local/root "/path/to/clojure-mcp"}}
                :exec-fn clojure-mcp.main/start-mcp-server
                :exec-args {:port 7888}}}
...

and launchpad will be able to call clojure-mcp.main/start-mcp-server
this way:

$ launchpad --execute mcp

Note that this is a completely new code path and neither start nrepl nor hooks up the hot reloading facilities.

@arichiardi arichiardi marked this pull request as ready for review May 29, 2025 19:47
This patch adds more superpowers to launchpad: it can now launch the
first configured `:exec-fn` (and relative `:exec-args`).

This behavior is enabled by adding `--execute` to the command line.

It does it by introducing a brand new `execute-steps` var containing,
among the others, the `exec-fn-eval-forms` step - the logic for
appending the correct `:eval-forms`.

Note that this is a completely new code path and neither start nrepl nor
hooks up the hot reloading facilities.

An example, you can configure an mcp alias (from bhauman/clojure-mcp)
within `deps.local.edn` like this:

```clojure
:aliases {:mcp {:extra-deps {org.slf4j/slf4j-nop {:mvn/version "2.0.16"}
                             com.bhauman/clojure-mcp {:local/root "/path/to/clojure-mcp"}}
                :exec-fn clojure-mcp.main/start-mcp-server
                :exec-args {:port 7888}}}
...
```

Launchpad will be able to call `clojure-mcp.main/start-mcp-server` this
way:

```
$ launchpad --execute mcp
```

Note that this is a completely new code path and neither start nrepl nor
hooks up the hot reloading facilities.
@arichiardi arichiardi changed the title Introduce --exec-fn option and functionality Introduce --execute option and functionality May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant