Skip to content

Instantly share code, notes, and snippets.

@keplersj
Created September 13, 2014 17:46
Show Gist options
  • Save keplersj/d4c1d4e1f8dae8253d8a to your computer and use it in GitHub Desktop.
Save keplersj/d4c1d4e1f8dae8253d8a to your computer and use it in GitHub Desktop.
Crafter Commands

Crafter

Resource = resource pack, mod, etc

All commands offer plumbing versions --plumbing. This offers machine readable output. Example below:

$ craft login username password
DONE success

Commands

Install: Installs a resource
    Run: Runs an instance
Upgrade: Upgrades a resource
 Update: Updates Crafter itself
 Create: Creates an instance
   Help: Show help
  Login: Logins with a user
   Logs: View instance logs
  Clone: Clones an instance
  Start: Async instance start
   Stop: Async instance stop
 Status: Status of instance

Clone

     <instance name>: Clones an instance
<gist, url, or file>: Installs an instance from location. Requires Craftfile, can include worlds (if archive) and configs.
             @params: [clone name]
             @prompt: source, clone name

Usage:

$ craft clone "My Instance" "New Instance"
==> Clone from "My Instance" to "New Instance"
==> Cloning instance...
==> Instance cloned ("My Instance" -> "New Instance")

$ craft clone <URL>
==> Unpacking...
==> Source specifies instance name: "Super mod pack"
    Enter a new name or leave blank, then press enter
    > Cool Modpack
==> Cloning instance...
==> Instance cloned (modpack.zip "Super mod pack" -> "Cool Modpack")

$ craft clone
==> Please enter an instance name, URL, gist id, or path to archive'
    > My Instance
==> Instance Selected:
--> MC Version: 1.6.4
--> Mods: Buildcraft, bacon, TE3
==> Please enter a name for the clone
    > [My Instance copy]
==> Cloning Instance...
==> Instance cloned ("My Instance" -> "My Instance copy")

Create

 @params: [Instance name]
 @prompt: instance name, MC version, type
@options: type (server/client/sponge), build (forge 901, sponge 102, etc), mc ver

Usage:

$ craft create "My Instance"
==> Client or Server?
    > client
==> Please specify Minecraft version:
    > 1.8.1
==> Sponge, Forge, or Vanilla?
    > Sponge
==> Resolving downloads...
==> Found download
==> Downloading Sponge 1.8.1 server
==> Sponge build 1012 downloaded
==> Downloading Forge 1.8.1 universal
==> Forge build 1234 downloaded
==> Creating instance layout
==> Copying files to instance
==> Instance "My Instance" created

Install

      <name>: Checks for mod or resource pack by that name
         mod: explicit mod install
resourcepack: explicit resourcepack install (alias to rp)
     @params: [instance name]
     @prompt: instance name

Usage:

$ craft install bacon "My Instance"
==> "My Instance" is MC 1.8.1 and Forge build 1234
==> Checking for compatible mods or resource packs by the name of "bacon"
==> Two matches
--> 1 [resourcepack] Bacon (by philbacon) (MC 1.6)
--> 2 [mod] Bacon (by hunterboerner) (Forge 1230 MC 1.8.1)
==> Which one? (Enter number)
    > 2
==> Installing mod...
==> Mod installed into "My Instance"

Run

 @params: [instance name] [username]
@options: offline, logs (tails logs)

Usage:

$ craft run "My Instance" myusername
==> Authenticating as "myusername"...
==> Authenticated
==> Running instance "My Instance"
==> MC 1.8.1 Sponge 123 Forge 1234
==> Mods:
    This Mod    That Mod    Other mod
==> Resource packs:
    Bleha       Bleh        Blehc
==> Instance running...

Upgrade

 <name>: Upgrades a mod or resource pack
    all: Upgrades all mods and resource packs in instance
@params: [instance name]

Usage:

$ craft upgrade buildcraft "My Instance"
==> "My Instance" has "buildcraft" version 1.234
==> Checking for new version of "buildcraft"
==> New version found (1.3 MC 1.8)
==> Removing old version
==> Installing mod...
==> Mod installed into "My Instance"

Start

 @params: [instance name]

Usage:

$ craft start "My Instance"
==> Starting instance "My Instance"
==> Started

Stop

 @params: [instance name]
@options: force (KILL IT NAOWWWWWWWWWWWWWWWWWWWWWWWWWWWW)

Usage:

$ craft start "My Instance"
==> Stoppping instance "My Instance"
==> Stopped

Status

@params: [instance name]

Usage:

$ craft status "My Instance"
==> Running

Logs

   tail: pipes location of log to tail
  where: gives location of log

@params: [instance name] [all/forge/mc/sponge (default all)]
@options: forever (gives every log, latest and past)
@prompt: instance name

Usage:

$ craft logs tail "My Instance"
==> Tailing all latest logs in "My Instance"
==> Logs found: MC, Forge, Sponge
<contents of logs>

$ craft logs where "My Instance" --forever
==> Showing location of all past and current logs in "My Instance"
==> Forge:
    /path/to/forge-log.log /path/to/forge-log-2.log
==> Minecraft:
    /path/to/minecraft-log.log
==> Sponge:
    /path/to/sponge-log.log

Update: No params.

Usage:

$ craft update
==> Updating Crafter to latest version...
==> Done

Login

@params: [username] [password]
@prompt: username, password

Usage:

$ craft login
==> Enter username or email:
    > Bleh@bleh.com
==> Enter password (will be hidden):
    >
==> Authenticating...
==> Successfully authenticated

$ craft login bleh@bleh.com superawesomepassword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment