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
17 changes: 17 additions & 0 deletions Ix/Cli/HashCmd.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Cli

def runHash (p : Cli.Parsed) : IO UInt32 := do
let input : String := p.positionalArg! "input" |>.as! String
IO.println <| "Input: " ++ input
return 0

def hashCmd : Cli.Cmd := `[Cli|
hash VIA runHash;
"Hashes a given Lean source file"

FLAGS:
e, "example" : String; "Example flag"

ARGS:
input : String; "Source file input"
]
17 changes: 17 additions & 0 deletions Ix/Cli/ProveCmd.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Cli

def runProve (p : Cli.Parsed) : IO UInt32 := do
let input : String := p.positionalArg! "input" |>.as! String
IO.println <| "Input: " ++ input
return 0

def proveCmd : Cli.Cmd := `[Cli|
prove VIA runProve;
"Generates a ZK proof of a given Lean source file"

FLAGS:
e, "example" : String; "Example flag"

ARGS:
input : String; "Source file input"
]
22 changes: 19 additions & 3 deletions Main.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
import Ix
import Ix.Cli.ProveCmd
import Ix.Cli.HashCmd

def main (args : List String) : IO Unit :=
IO.println s!"Hello, {args}!"
def VERSION : String :=
s!"{Lean.versionString}|0.0.1"

def ixCmd : Cli.Cmd := `[Cli|
ix NOOP; [VERSION]
"A tool for generating content-addressed ZK proofs of Lean 4 code"

SUBCOMMANDS:
proveCmd;
hashCmd
]

def main (args : List String) : IO UInt32 := do
if args.isEmpty then
ixCmd.printHelp
return 0
ixCmd.validate args
12 changes: 11 additions & 1 deletion lake-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{"version": "1.1.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/argumentcomputer/LSpec",
[{"url": "https://github.com/leanprover/lean4-cli",
"type": "git",
"subDir": null,
"scope": "",
"rev": "efa5aa20504b88e2826032ddaa606c7965ec9467",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "efa5aa20504b88e2826032ddaa606c7965ec9467",
"inherited": false,
"configFile": "lakefile.toml"},
{"url": "https://github.com/argumentcomputer/LSpec",
"type": "git",
"subDir": null,
"scope": "",
Expand Down
3 changes: 3 additions & 0 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ lean_exe ix where
require LSpec from git
"https://github.com/argumentcomputer/LSpec" @ "ca8e2803f89f0c12bf9743ae7abbfb2ea6b0eeec"

require Cli from git
"https://github.com/leanprover/lean4-cli" @ "efa5aa20504b88e2826032ddaa606c7965ec9467"

section Tests

lean_exe Tests.Blake3
Expand Down