# Error "command not found" when I'm using Go IPFS API

**URL:** <https://discuss.ipfs.tech/t/error-command-not-found-when-im-using-go-ipfs-api/916>\
**Category:** Help\
**Tags:** go-ipfs\
**Created:** [August 9, 2017, 12:52pm UTC](https://discuss.ipfs.tech/t/error-command-not-found-when-im-using-go-ipfs-api/916 "2017-08-09T12:52:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![macabeus](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/macabeus/32/2454_2.png) [@macabeus](https://discuss.ipfs.tech/u/macabeus)\
**Post date:** [August 9, 2017, 12:52pm UTC](https://discuss.ipfs.tech/t/error-command-not-found-when-im-using-go-ipfs-api/916/1 "2017-08-09T12:52:07Z")

</div>

I’m want to use IPFS in my project, then, I’m studying about Go IPFS API.  
Then, I wrote this very simple code:

```auto
package main

import (
	"fmt"
	"bytes"
	sh "github.com/ipfs/go-ipfs-api"
)

func main() {
	shell := sh.NewShell("https://ipfs.io")

	bufferExample := bytes.NewBufferString("Hello IPFS Shell tests")
	mhash, err := shell.AddNoPin(bufferExample)

	if err != nil {
		panic(err) // ends where
	}

	fmt.Println(mhash)
}

```

But I receive the error `panic: add: command not found`, and I don’t understand why. I already have IPFS in my computer (I can run the deamon, for example). I also installed the Go IPFS library with development dependencies.

How to fix it?

---

<div class="post-metadata">

**Author:** ![Magik6k](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/magik6k/32/2318_2.png) [@Magik6k](https://discuss.ipfs.tech/u/Magik6k)\
**Post date:** [August 9, 2017, 1:21pm UTC](https://discuss.ipfs.tech/t/error-command-not-found-when-im-using-go-ipfs-api/916/2 "2017-08-09T13:21:52Z")

</div>

You can’t use the public IPFS gateway to add content. For this you need locally running daemon and pass it’s API endpoint to NewShell (localhost:5001 by default).

Public gateways([ipfs.io](http://ipfs.io), localhost:8080) only support a limited API subset, see [https://github.com/ipfs/go-ipfs/blob/master/core/commands/root.go#L141](https://github.com/ipfs/go-ipfs/blob/master/core/commands/root.go#L141) for what is available

---

<div class="post-metadata">

**Author:** ![macabeus](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/macabeus/32/2454_2.png) [@macabeus](https://discuss.ipfs.tech/u/macabeus)\
**Post date:** [August 9, 2017, 1:34pm UTC](https://discuss.ipfs.tech/t/error-command-not-found-when-im-using-go-ipfs-api/916/3 "2017-08-09T13:34:09Z")

</div>

Very thank you! Now, it’s work!

And… one more question: I **always** need run a daemon if I want send a file to IPFS? In my Go project, it’s not good… We have other solution?

---

<div class="post-metadata">

**Author:** ![es\_00788224](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@es\_00788224](https://discuss.ipfs.tech/u/es_00788224)\
**Post date:** [August 9, 2017, 10:05pm UTC](https://discuss.ipfs.tech/t/error-command-not-found-when-im-using-go-ipfs-api/916/4 "2017-08-09T22:05:20Z")

</div>

> [@macabeus](#):
>
> I always need run a daemon if I want send a file to IPFS?

You send the file to your daemon. If the daemon is running other people can access the file. You never send it “to IPFS”, you never store anyone else’s content you didn’t ask for.
