Command line tooling for SimplicityHL (previously Simfony), a high-level language for Bitcoin's Simplicity smart contracts. Also available as a Python module via PyO3. This projects originates from https://github.com/m-kus/simply
Simply is a comprehensive tool providing development, testing, and deployment capabilities for SimplicityHL programs. It supports the complete workflow from writing SimplicityHL code to deploying and interacting with Bitcoin smart contracts.
With the Python bindings (pysimply), you can use all CLI commands programmatically from Python scripts.
pip install pysimplyThis is the recommended installation method for Python users.
cargo install --git https://github.com/m-kus/simply simplyThe Rust CLI provides the same commands as the Python module.
Simply exposes all commands via the CLI and Python module:
build– compile a SimplicityHL programrun– execute a program with optional witness and argumentstest– automatically discover and run test functionsdeposit– generate a P2TR address for the programwithdraw– spend a transaction output using the programsign– sign arbitrary data with BIP340
CLI users can run
simply <command> [OPTIONS]. Python users can usepysimply.run_cli_command(cmdline).
import sys
import pysimply
def main():
# Setup logging (optional)
pysimply.setup_logger("info")
# Prepare the CLI command as a space-separated string
cli_args = sys.argv[1:]
cmdline = " ".join(cli_args)
# Execute the command
result = pysimply.run_cli_command(cmdline)
print(result)
# Uncomment to see the internal logger buffer
# print(pysimply.get_logs(), flush=True)
if __name__ == "__main__":
main()Example usage:
# Run build command via Python
poetry run python demo/main.py sign --message e59ff97941044f85df5297e1c302d260b85f8bcee3b4b8a0b1b6dddfc6b8c3b0should give
Signature (BIP340): 955d986df90dccdbd2e4627efa7106f5a3e1d3c696209dc21545696b1995617cb73ec01a2259b24f450465436384564e85743c0804557757e8d480e1ca7efbc8
Message: e59ff97941044f85df5297e1c302d260b85f8bcee3b4b8a0b1b6dddfc6b8c3b0
Public key (x-only): 0b6b1a78c5c1063dcbded6bd599361d79add3824ea27951c2cee22c9fcb21f5b
Private key: 97a34cc12c99a698a44fbbde3bf59f155252e28df9184cc1440f4cbc6d593267
Command executed successfullyRun build command via Python
poetry run python demo.py build --entrypoint main.simfRun test command via Python
poetry run python demo.py test --entrypoint tests.simfpysimply.setup_logger(level: str)– initialize logger ("off","error","warn","info","debug","trace")pysimply.get_logs()– return the internal log buffer as a string
{
"witness": [...]
}{
"arguments": [...]
}