Skip to main content

Five Minute Quick Start

Welcome To Cape! Thank you for trying our free beta release. Cape is a serverless confidential computing platform. It enables you to easily encrypt data, and deploy and run code confidentially, ensuring the protection of your users' data and your code.

This quick start will walk you through installing the cape cli, and using the cape run and cape encrypt commands. It'll take about 5 minutes.

Install the Cape CLI

The Cape CLI is a single binary named cape. The following command will download the appropriate version for your OS and platform, and place it under $HOME/.cape/bin:

curl -fsSL https://raw.githubusercontent.com/capeprivacy/cli/main/install.sh | sh

Alternatively, you can manually download a release from Github. Simply untar the binary into a folder included in your $PATH. We chose /usr/local/bin in this example:

tar -C /usr/local/bin -xzf cape_<version>_<architecture>.tar.gz

Note: sudo may be required when running this command.

Sign up for Cape

Sign up for Cape by simply running cape signup (or cape login if you've logged in before). Cape uses your Github account for login.

cape signup

If your terminal is able to, it will auto-launch a browser (if not, open the link provided manually). Finish the sign-up process with your browser by confirming that the code you see there matches the code you see in your terminal.

Run a function

You can invoke a previously deployed function with the cape run command. It accepts a function name and input data as arguments. We've already deployed some examples to demonstrate the platform; here is how you can invoke the sentiment analysis function:

cape run capedocs/sentiment 'Hello World'

92.88% positive

Feel free to experiment with your own phrases! The inputs to cape run are always confidential; In other words, they are encrypted before they leave your machine, and can only be processed by Cape's secure enclave.

Use encrypted data

Cape makes it easy to encrypt any data using the cape encrypt command. The encrypted data can only be processed by Cape functions.

Encrypt a phrase and pipe into a file:

cape encrypt 'Hello World' > encrypted.data

Then invoke the same function, using the file as input:

cape run capedocs/sentiment -f encrypted.data

92.88% positive

Run functions in JavaScript or Python

Running Cape functions from the command line is great, but to integrate Cape into your app you’ll want to use one of our SDKs.

Here's a quick example of encrypting data and running a function in JavaScript:

const encryptedData = cape.encrypt('Hello World')
const result = await cape.run({ 'capedocs/sentiment', encryptedData });
console.log(result);

92.88% positive

Or a similar example in Python:

encryptedData = cape.encrypt('Hello World')
result = cape.run( 'capedocs/sentiment', encryptedData)
print(result)

92.88% positive

Checkout the cape-js and pycape SDKs on GitHub for complete examples.

Next, we'll show you how to deploy your own functions!

Join the community


Note

We are actively soliciting feedback from our beta. Please use this form to provide feedback.